i have a json array (from http request) in structure 1 and would like to convert it to structure 2.
i couldn’t find how to do it. please assist
in output structure
value of A should be from [telemtry][device.type.id][value]
value of B should be from [telemtry][dout][ts]
value of C should be from [telemtry][ident][value]
1):
{“result”:[
{“id”:2921921,“telemetry”:{“device.type.id”:{“ts”:1688045198.137252,“value”:92},“dout”:{“ts”:1688045196,“value”:3},“ident”:{“ts”:1688045198.137252,“value”:“860037053946266”}}},
{“id”:3001213,“telemetry”:{“device.type.id”:{“ts”:1688045190.04825,“value”:92},“dout”:{“ts”:1686827846,“value”:0},“ident”:{“ts”:1688045190.04825,“value”:“866562062181492”}}},
{“id”:3001217,“telemetry”:{“device.type.id”:{“ts”:1688044791.966603,“value”:92},“dout”:{“ts”:1686736102,“value”:2},“ident”:{“ts”:1688044791.966603,“value”:“863192057838832”}}}]}
{“result”:[
{“A”:92,“B”:1688045196,“C”:“860037053946266”},
{“A”:95,“B”:1688055596,“C”:“860037053946244”},
{“A”:93,“B”:1688444496,“C”:“860037053946299”}]}
Hi @Rafi_Newman,
There are a couple of ways to do it, You can use Text Aggregator or Create a JSON module. But for this, the easier approach will be to use Text Aggregrator,
- Add an Iterator after the HTTP module and Iterate over the Result that you are getting from the HTTP. Make sure to enable Parse response Checkbox in HTTP Module
- After the Iterator, Put a Text Aggregator, whereby you will construct the child JSON element in the resultant JSON array,
After which, in the module that you want to send the result JSON, you can then construct the overall JSON by doing,
You can test this blueprint and review how it works.
blueprint (46).json (6.6 KB)
hi,
i followed your exact instructions but in the text selection i get only telemetry in green and blue, and not the full path of the inner element as in your screenshot. why?
hi
i still didnt get answer for last question
That seems, weird, What you can do is run the module that generates those details, you can unlink rest of the module and just run the module, that will generate the data, that way once the relevant modules are run once, you can then use the mapping.
1 Like
i did that many times. i tried many combination. and nothing
i always get only the [Telemetry] without the inner items.
make a test by your self by using HTTP request that result with this json (make it a static resource file that you read by http)
you can also try fixing my sceario: Remove unnecessary fields from Flespi messages
Hello there @Rafi_Newman 
I wanted to quickly jump in and clarify that this forum functions as a user community. In other words, it serves as a platform where Make users and enthusiasts come together to discuss solutions. It’s important to note that we don’t have direct access to your account or specific scenarios.
Thanks for understanding 