Hi James,
Yes, you should be able to build what you need.
I built a test data action to confirm it, and will provide the details below so you can take a look and try to apply it to your case.
But to summarize, you have to work within the "successTemplate" of your data action to ensure the results are always of the same type (In my case I tried to ensure the results are always a string, as that seems to be what you would need. If it was always an integer the initial 0 would be removed from the strings that you have).
An example of the final configuration for what I have:
{
"translationMap": {
"price": "$[4].data.price"
},
"translationMapDefaults": {},
"successTemplate": "{\n \"price\": \"$price.replace('\"', '')\"\n}"
}
I also created "price" as an string on the output contracts:
---------
This public API on the 5th object returns price as an integer:
{
"id": "5",
"name": "Samsung Galaxy Z Fold2",
"data": {
"price": 689.99,
"color": "Brown"
}
}
Which gets converted to a string on the data action.
You can also check that it works for the value being returned as a string on the API on the 12th object:
{
"id": "12",
"name": "Apple iPad Air",
"data": {
"Generation": "4th",
"Price": "419.99",
"Capacity": "64 GB"
}
}
But to test the above object you have to change the data action to this:
{
"translationMap": {
"price": "$[11].data.Price"
},
"translationMapDefaults": {},
"successTemplate": "{\n \"price\": \"$price.replace('\"', '')\"\n}"
}
Let me know if this helps, or share some more details of the structure of your action and I can try to help with setting up what's missing.
------------------------------
Marcello Jabur
------------------------------