AnsweredAssumed Answered

Get Json element

Question asked by atwharton on Jun 27, 2018
Latest reply on Jun 27, 2018 by bigtom

Hi i have created a script which pulls the distance from two points and i was wondering how i would get the value for the distance into a number field. Please see json below:-

 

{

   "destination_addresses" : [ "destination address" ],

   "origin_addresses" : [ "origin address" ],

   "rows" : [

      {

         "elements" : [

            {

               "distance" : {

                  "text" : "176 mi",

                  "value" : 282922

               },

               "duration" : {

                  "text" : "3 hours 5 mins",

                  "value" : 11112

               },

               "status" : "OK"

            }

         ]

      }

   ],

   "status" : "OK"

}

 

The script first pulls the get url into a txt field i am then trying to get the value of the dsitance in a number field. I hope this makes sense. This is what i have put into my getjsonelement line

 

JSONGetElement ( SITES::JSONdistxt ; "rows.elements.distance[1]value" )

Outcomes