Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

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!

  • Author

I figured it out.  Here is the code that gets the job done.

 

JSONSetElement ( $$json ; ["tracking_numbers[0]" ; "4324234" ; JSONString]; ["tracking_numbers[1]" ; "2342342" ; JSONString] )

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....

  • Author
57 minutes ago, rwoods said:

.....

Exactly! We over-lapped there....

Overlapped indeed!  I appreciate you taking the time to answer nonetheless!  Thanks!

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.