Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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 ?
@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 }.
Could you please share more information?
Thanks
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:
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.
@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 }.
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 !