cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping a rest API response in Build Apps

souvikroy
Participant

I am consuming a REST API in Build App and need to map few fields from data collection and as well as msgs.count from collections collection as shown in below images.

I have added below code in Response mapper to map fields from the data collection and created an entity.

{ records: response.data.data , driverCode: response.status }


Is it possible to map the msgs.count from collections collection as well in the same entity along with other fields from data collection from the rest API?

Dan_Wroblewski
Developer Advocate
Developer Advocate
0 Kudos

the JSON you show all comes from same response, I assume?

can you show what you want to end up with?

View Entire Topic
MarcHuber
Product and Topic Expert
Product and Topic Expert
0 Kudos

With { records: response.data.data , driverCode: response.status } you are filtering the results for the data entity of your api call. Just remove the response mapper. Afterwards you will have access to also to the collections entity.

Best regards,

Marc

souvikroy
Participant
0 Kudos

Hi Marc, Thanks for your reply. The reason I added the response mapper, so that I can bind the response with the list report correctly otherwise, I will not be able to bind the response to a data variable to repeat it as list.

Ben_Samuel
Explorer
0 Kudos

Thanks Marc, 

it works for me and i can bind it correctly