cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SAP Build REST API response mapping with LIST control in SAP BUILD

YogSSohanee
Participant
0 Likes
2,790

In my SAP BUILD app, i created a new classic data entity with following option: i.e. "SAP BTP Destination REST API Integration".

I have set the data variable which will pick up this data from REST API and put it in a Data variable.

With this setup, in the UI Canvas, I am using a “List Item” control and binding its “Repeat with” property with data.Customer_Data.value.value

And setting its primary label binding with current.formattedName

I am expecting to display a list of customer formattedName field value to be displayed as a repeated result in this list on load of the app screen.

But its not loading the desired result with this list control. Can anyone please suggest if I am missing anything.

Accepted Solutions (1)

Accepted Solutions (1)

MarcHuber
Product and Topic Expert
Product and Topic Expert
0 Likes

In your data source there is a button "Autodetect Schema from Response" after you successfully run a test. If you press this button, you will see all the fields also selectable in the UI.

MarcHuber
Product and Topic Expert
Product and Topic Expert

probably you need to enter in the Response Mapper the following formula: {driverCode: response.status , records: response.data.value}

YogSSohanee
Participant
0 Likes

Thanks Mark for responding. I did this step already and as a result i am able to see this structure in my list properties.

Once i save this I am able to preview the sample value from API in the preview section.

But when I try to launch the app output, it doesnt show the list of customer names.

Answers (2)

Answers (2)

vikas_992001
Explorer
0 Likes

Hi Yogesh,
I tested the same scenario on my demo app and I have a working solution for you. just follow the below steps and add some modifications.

1. Create a custom schema at base where field key should refer to the key value of output data.

2. Pass request headers as "Header name : Content-Type , Header Value : application/json" in the same base section.

3. in Data variable section modify your "Set data variable" section with this "outputs["Get record collection"].records.value".

Now test your output with using Alert or any Dialog box.

Please provide your response if it works or not.

YogSSohanee
Participant
0 Likes

daniel.wroblewski , vikastechgupta Appreciate if you can have a look at this question, Thanks in advance! 🙂

Ben_Samuel
Explorer
0 Likes
hi YogSSohanee, i have the same issue - can you share the solution to this? thanks