Skip to main content
Answered

Handling Missing Variables in Custom Action POST Request to Prevent Failure

  • January 26, 2025
  • 1 reply
  • 6 views

Hi everyone,

I’m working with a Custom Action in Intercom, where I send a POST request that includes a variable from the conversation data. However, sometimes this variable is missing for certain conversations, which causes the POST request to fail.

Is there a way to create a fallback or default value for such variables in the request body to prevent the failure?

For example, here’s my current setup:

If data is not available, how can I ensure the request still goes through, possibly by setting a default value (like null or a placeholder string)?

Any advice or examples specific to handling this in a Custom Action would be greatly appreciated.

Best answer by Jacques Reynolds

Hey ​@Yevgeniy Borisovsky 👋 Jacques here from Intercom Support. I hope all is well today!

When working with Custom Actions in Intercom, if a variable from the conversation data is missing, causing your POST request to fail, you cannot set fallback values directly within the API currently. If a value is recognized as NULL, the custom action will fail to run.

As a workaround, you would need to ensure that all attribute values used in the request are not empty by programmatically setting values for any attributes that are NULL before the custom action is triggered.

This is a great idea though and something that would improve the functionality of our custom actions feature.

You can check if this feature has been recorded on our Product Wishlist in our Community. You can search and upvote existing requests or create new requests 🙌 

 

 

 

View original
Did this topic help you find an answer to your question?

1 reply

Jacques Reynolds
Intercom Team
Forum|alt.badge.img+4

Hey ​@Yevgeniy Borisovsky 👋 Jacques here from Intercom Support. I hope all is well today!

When working with Custom Actions in Intercom, if a variable from the conversation data is missing, causing your POST request to fail, you cannot set fallback values directly within the API currently. If a value is recognized as NULL, the custom action will fail to run.

As a workaround, you would need to ensure that all attribute values used in the request are not empty by programmatically setting values for any attributes that are NULL before the custom action is triggered.

This is a great idea though and something that would improve the functionality of our custom actions feature.

You can check if this feature has been recorded on our Product Wishlist in our Community. You can search and upvote existing requests or create new requests 🙌 

 

 

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings