Web request, get JSON data numeric value

  • 15 March 2022
  • 3 replies
  • 79 views

When including a WebRequest control within the Nintex Form for O365, I'm unable to retrieve a NUMERIC value - only TEXT values.

This is to retrieve a weather value - the TEXT values are easy...

{"coord":{"lon":138.6007,"lat":-34.9285},"weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04d"}],"base":"stations","main":{"temp":32.67,"feels_like":32.35,"temp_min":31.86,"temp_max":33.87,"pressure":1012,"humidity":35,"sea_level":1012,"grnd_level":1005},"visibility":10000,"wind":{"speed":1.57,"deg":25,"gust":2.27},"clouds":{"all":87},"dt":1647313538,"sys":{"type":2,"id":2037292,"country":"AU","sunrise":1647290653,"sunset":1647335115},"timezone":37800,"id":2078025,"name":"Adelaide","cod":200}

These all work ;

$.weather[*].description

$.weather[*].main

$.sys.country

 

BUT - when trying to get numeric values, there's an error ;

$.main.temp_min

$.main.temp_max

 

How do I convert this to a TEXT value - as a NUMBER doesn't work...

ERROR ;

Error with webservice: Error: Value does not match with given schema type.

 

 

 


3 replies

Badge +6

@Chris_Kachihro , did you ever figure this out? I can't get a numeric value either, I wasn't sure if it was by design or if there was something wrong with my notation. Text all works fine for me as well, and using the same JSON path request in a workflow works for numbers, just not in the form.

No, sorry - we didn't end up being able to do the 'temp'....     We had a SPList created instead - and create a ListItem for the weather 'each day' using PowerAutomate, and WebRequest result.


 


And the NintexForms just showed/saved the data from the SPListItem

Badge +6

I ended up opening a ticket with Nintex, the answer was that it was by design, even though one of their own videos shows it working correctly 2 years ago. Their workaround is for me to export the form, edit the json, then import it back in. This works, but begs the question, why can't it just work in the form design if it's as simple as changing one word in the json?


 


In the meantime, I taught myself how to create a custom connector in Power Automate and used it to do the same as you did, create a flow that pulls the data into a list and look it up from that.

Reply