How to extract the value, given a key, for JSON data?

Created on 7 February 2025, 17 days ago

It's not clear how to extract data from a JSON objects

We have used the great ECA Helper module to send and receive data via HTTP request.

The returning object is a JSON object, and we can access this easily enough (via [token:json]) to verify the data we are receiving

However, we have attempted using ECA Tamper's JSON decode to extract the individual values, given their keys, without much luck, maybe it's a lack of understanding or basic knowledge of the ECA tamper decode UI or even how ECA handles arrays for this particular requirement.

Example, if we get this returned:

{
 	“NumberProperty”: 10,
 	“FloatProperty”: 20.13,
 	“BooleanProperty”: true,
 	“EmptyProperty”: null
}

- how can we access 'Float Property' value '20.13' from the JSON object?

Thank you for your time.

💬 Support request
Status

Active

Version

2.1

Component

User interface

Created by

🇦🇺Australia PetarB

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @PetarB
  • 🇩🇪Germany jurgenhaas Gottmadingen

    If I remember correctly the ECA Helper module already decodes the payload, so what you get in the token is an array. That said, you should be able to access the properties in that array with either [yourtoken:json:FloatProperty] or [yourtoken:FloatProperty].

    You may want to use the Debugging techniques to see the exact data structure of that token, so that you can find the correct syntax.

    You don't need the eca_tamper module, so I'm moving this to the eca_helper module, as it belongs there.

  • 🇻🇳Vietnam zipme_hkt

    The http client return raw data, because sometime data return not json format.

    You need convert json string to array token then access it.

    Please check upload images it will help you how to convert

Production build 0.71.5 2024