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?
Request clarification before answering.
To manipulate in the data resource, you would take your formula you used (and Marc rightly said was unnecessary above) but now use it and add functions to manipulate the data, now that you want to manipulate here.
Just as an example, I took Northwind and set the retrieve to return the first record.

Then I added this to the response mapper ...
{ records: PICK_KEYS(response.data,["CustomerID", "City"]), driverCode: response.status }
... so that it returned the same record but with fewer fields.

You can do whatever you need in the formula.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Souvik,
Please see my response in this one. Hope this will work for you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am assuming this question is related to the other question you entered.
So you could:
It depends which data you will need and when.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.