Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
Old_Blendr_man
Contributor II
Contributor II

SalesForce RAW API request: No error response available

When using the SalesForce RAW API request it works as long as there is valid data and no errors. 

Unfortunately life isn't always what we expected and this means we can run into an error at the API connection. 

The Blendr system had several options to retrieve the returned error and do smart things with it. But it looks like Qlick is awaiting the perfect world and doesn't have any options to check for the error and handle it in the automation ? 

Labels (4)
1 Solution

Accepted Solutions
AfeefaTk
Support
Support

@Old_Blendr_man I think you can use the error formula to catch the error.

The basic formula looks like this:

{ $.state.blockName.error }

To return specific error status, use { $.state.blockName.error.response.status }.

To return the error body, use { $.state.blockName.error.response.body }.

https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_QlikAutomation/working-with-...

View solution in original post

4 Replies
AfeefaTk
Support
Support

Hi @Old_Blendr_man 

Could you please share more information?

  • The exact issue you are facing
  • What is expected behavior and the current behavior
  • Automation workspace and failed automation run json file

Thanks

 

Old_Blendr_man
Contributor II
Contributor II
Author

Hi @AfeefaTk ,

It basically is valid for every component that is using some kind of API connection. 

Below an example of a random error that, in this case, SalesForce produces:

{
"error": "Error calling endpoint \"Salesforce - Delete Contact\"",
"endpoint": {
"name": "Delete Contact",
"datasource": "Salesforce"
},
"request": {
"url": "https://*****.my.salesforce.com/services/data/v50.0/sobjects/contact/Contact ID",
"method": "DELETE"
},
"response": {
"body": {
"code": "CURLE_URL_MALFORMAT",
"message": "URL rejected: Malformed input to a URL function"
}
},
"external error": true
}

Qlik detects this error and there are three ways to handle the error:

  • Ignore
  • Warning
  • Stop

In Blendr when you choose Warning  you had the option to "grab" the above json and do whatever you wanted to do with it. 

This gave you the option to get the response.body.code for example and do some clever things like if statements around response.body.code for example.  

So our problem is not the error or the error response itself, this is just an example. 

 

AfeefaTk
Support
Support

@Old_Blendr_man I think you can use the error formula to catch the error.

The basic formula looks like this:

{ $.state.blockName.error }

To return specific error status, use { $.state.blockName.error.response.status }.

To return the error body, use { $.state.blockName.error.response.body }.

https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_QlikAutomation/working-with-...

Old_Blendr_man
Contributor II
Contributor II
Author

AHA ! 

Many, many thanks! 

Took a few seconds to find the blockname, but after that it worked. 

I did search for error handling in the wiki, but this subject didn't come up. 

Thank you !