Skip to main content
Answered

How should I make Object Mapping with response of a list?

  • April 18, 2025
  • 1 reply
  • 17 views

Hi team, 

I’m trying to fetch user information with external API. The example response was like : 

{
    "list": [
        {
            "customer": {
            	"id":"123",
                "first_name": "Darth",
                "last_name": "Vader",
                "email":"darthvader@deathstar.com"
            }
        }
    ]
}

I can see the example response in Data Access but since the first layer is a list, I can’t mapping that in Object Mapping. Could you suggest how should I mapping these data? Thank you. 🙏

 

 

 

 

Best answer by Paul B12

Hey ​@AdamChenAppier 

If your API response starts with a list, Intercom can’t map it directly it expects a flat object at the root level.

To resolve this, either adjust the API to return a single object or use a middleware to extract and flatten the data. Make sure the fields you want to map (like email or first_name) are at the top level and match Intercom’s expected data types. This ensures your custom action maps the data correctly into user or company profiles.

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

Paul Byrne
Intercom Team
Forum|alt.badge.img+2

Hey ​@AdamChenAppier 

If your API response starts with a list, Intercom can’t map it directly it expects a flat object at the root level.

To resolve this, either adjust the API to return a single object or use a middleware to extract and flatten the data. Make sure the fields you want to map (like email or first_name) are at the top level and match Intercom’s expected data types. This ensures your custom action maps the data correctly into user or company profiles.


Reply


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