Jump to content

JSON - SetElement Help!


This topic is 2030 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hi Everyone,

I've got a JSON issue that I've been struggling to figure out.  Here is a sample output of what I'm trying to do:

{
  "fulfillment": {
    "location_id": 905684977,
    "tracking_numbers": [
      "a4e6e7ca452c7873c2ef10234d042352",
      "81669206ee8e6164da5ac190af93e6ca",
      "3def69908a9530b5c46b282a988cf914"
    ],
    "line_items": [
      {
        "id": 466157049
      },
      {
        "id": 518995019
      },
      {
        "id": 703073504
      }
    ]
  }
}

It's the "tracking_numbers" that is throwing me off.  I can build normal arrays like "line_items" no problem, but I've no idea how to structure the JSONSetElement function in a way that gives me multiple values for a single key as seen in "tracking_numbers".  Any help would be greatly appreciated!

Link to comment
Share on other sites

Hello

Just looking at the documentation it says :-

 

You can set multiple elements by providing an additional set of keyOrIndexOrPath, value, and type parameters in brackets [ ] for each element. The following syntax sets N elements at once:
JSONSetElement ( json ; 
   [ keyOrIndexOrPath1 ; value1 ; type1 ] ; 
   [ keyOrIndexOrPath2 ; value2 ; type2 ] ; 
   ...
   [ keyOrIndexOrPathN ; valueN ; typeN ]
)
 
Does that help
 

Exactly! We over-lapped there....

  • Thanks 1
Link to comment
Share on other sites

This topic is 2030 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.