Get Error Message From External Collection Response Object

When I make my api call to my external collection, I can only add a field to the smart text is the response is not blank? So even though the key, displayName is in the json response, it cannot be added

{
  "idToken": "[ID_TOKEN]",
  "email": "[user@example.com]",
  "refreshToken": "[REFRESH_TOKEN]",
  "displayName": "",
  "localId": "tRcfmLH7"
}

The other issue is when the API call returns an error response, how do I get the error message that is returned in the response? I would expect that in all cases I would have access to the response object but I cannot see how to get it.

Thanks in advance

With your API call, try to ensure that all fields have a value in them. You may need to manually set a displayName in your external collection order to get that value to populate in the API parameters properly.

The error scenario has to be configured based on a parameter.

For example: I set up an integration with an external API where it calls an external user by email. It uses the logged-in user’s email (from adalo) to query the external collection for that specific user. Then, it updates the internal user with their idToken so that they are kinda linked. The error occurs and the user id token is not updated and left blank.

If the call happens and is successful, the logged-in user idtoken is updated and added.
So then the logged-in user idtoken is not equal to blank, I send them to a success modal.

If the call happens and is an error, the user idtoken is not updated.
So then if the logged-in user idtoken is equal to blank, I send them to an error modal.

You don’t understand the question, so I will try again

The response from the server has a blank in the json response not the parameters I am sending in the request.

As for the error, I want the data from the error to provide a real, contextual response to the user.

What is the API you are trying to use?