Select to view content in your preferred language

Need help with the correct pulldata(@json) syntax

2286
2
Jump to solution
08-09-2023 12:26 PM
MFazio
by
Regular Contributor

I have an API call the returns weather data in the following JSON object:


MFazio_0-1691608837653.png

 

I am attempting to auto populate 4 fields using the "temp", "wind_speed", "wind_deg", and "weather - description" attributes. I have tried many different iterations and none of them have successfully populated the fields. Here are examples that I have tried:

For the first 3 attributes I've tried:

pulldata("@json", ${weather_json}, "data.temp")

pulldata("@json", ${weather_json}, "data.[temp]")

pulldata("@json", ${weather_json}, "data[temp]")

 

For the "Weather Description", I've tried:

pulldata("@json", ${weather_json}, "data.weather[description]")

pulldata("@json", ${weather_json}, "data.weather.description")

pulldata("@json", ${weather_json}, "data.[weather.description]")

 

Are all of these iterations wrong? I know I am successfully getting a JSON response because I have a multiline text field that populates for development purposes. 

MFazio_1-1691609147463.png

 

Any helps or suggestions would be appreciated!

 

Thanks,

Mike F.

 

Tags (3)
0 Kudos
1 Solution

Accepted Solutions
MFazio
by
Regular Contributor

For posterity, I've been able to solve my problem by accessing the index of the JSON for which my parameters reside. Since the 3.0 API is shaped differently than the the previous version, you must include the index of the list then the parameter. e.g. -
To access the Weather - Main parameter: 

pulldata("@json", ${weather_json}, "data[0].weather[0].main")

 

Hope this helps anybody who runs into the same problem I had!

 

 

View solution in original post

2 Replies
MFazio
by
Regular Contributor

For posterity, I've been able to solve my problem by accessing the index of the JSON for which my parameters reside. Since the 3.0 API is shaped differently than the the previous version, you must include the index of the list then the parameter. e.g. -
To access the Weather - Main parameter: 

pulldata("@json", ${weather_json}, "data[0].weather[0].main")

 

Hope this helps anybody who runs into the same problem I had!

 

 

laura1719981
Emerging Contributor

LauraAlejandraMerchanLeon_1-1693323883766.png

 

I have the same problem, but I can't solve it. :c Can you help me?

0 Kudos