web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Dynamically add to JSO...
Power Automate
Answered

Dynamically add to JSON Array in HTTP POST

(0) ShareShare
ReportReport
Posted on by 6
Hello all,
 
I created a MSFT Form where a user can enter details on a destination and package dimensions, and then get a bunch of trucker delivery rates via a power automate API call.
At first I set up this form to account for only one package; I have now been informed this could be anywhere between 1 and 6 packages per rate quote. So I need to add to this array.
 
Unfortunately, I can not just add more packages and have them be zero on weight and dimensions....if any extra packages are detected in the array, the call will account for all of them and then fail when there are zero or null on weight/dims.
 
I am struggling to find the best way to dynamically add to the "packages" array in my HTTP POST, based on whether the forms fields for extra packages have been filled in.
I know I could create a whole bunch of conditions then have 6 different API calls if the quote has 1,2,3,4,5, or 6 packages (12 total since there's two facilities).....but there must be a better way.
 
  "Packages": [
    {
      "Weight": "100",
      "Dimensions": {
        "PackagingWeight": ,
        "Width": 40,
        "Height":  20,
        "Length": 40
      },
      "Items": [
        {
          "SKU": "",
          "Description": "",
          "Quantity": ""
        }
      ]
    }
  ]
 
The flow is pretty simple at the moment, with conditions based on shipping facility and whether or not the rates are successfully pulled
 
Categories:
I have the same question (0)
  • Verified answer
    Chriddle Profile Picture
    8,708 Super User 2026 Season 1 on at
    After creating a package array, you can remove elements with zero weight using a filter action.
  • PB-03031956-0 Profile Picture
    6 on at
    @Chriddle that makes sense, but I think I need some guidance on this.
    The form response does not have the array; what would be the best way to create this so that I can filter it, then use that in the HTTP call?
     
    Form response:
      "body": {
            "responder""",
            "submitDate""3/3/2026 7:40:20 PM",
            "r4563c2d85782411880dd694469fc9b9e""",
            "r3c727a3b9dd14b5e86429539479aa921""",
            "rc7fbf7ec3ca3497da2319cecc839cb97""120",
            "r302f150a42c14eb08da8daf400eb7205""",
            "rac3c59b927334051a025c5aa08c08c49""",
            "rcc5f877dbd08416189c13c67a63c271d""",
            "r03d007b14c6741109e73113778353dec""",
            "r11df0d75fe884ee593e5fb652a65dd07""",
            "r921953ad9e324cd4ab74d11057bbbabb""",
            "r514a09a8713741b982aeefaf45010580""",
            "rdc0e7f6e5c4d4bf49f340e85ac417944""BUR",
            "rb19f66ea30584e42bba1d6fd6e1f8342""40",
            "reb6c0122f8a140c3bb5203224508cb9d""",
            "r458f3f4165034aa5908c268c132b2356""",
            "r615df41750f04126b005198815910b51""",
            "rf51665e331cf4d33817e4d68f627c04b""",
            "r20130cc08ef3444096a6f3d472c66fea""",
            "r2dbaaf3e08ad4d64ac1575b039c6e853""",
            "r53e3be00a3b748c88a42ff4c5c356f8c""",
            "r29ff11fda3ec48c3a945f6aaf5a7a557""",
            "r4e74bd29cb5646a4aa9417d6bcfe7f3e""",
            "rfb1e6b338ae341d3b930019248db678a""",
            "rfca1ed3bbd464649b6ebb839e37e4061""",
            "rfca1ca40e99e4793a3c114dc9ed4931e""",
            "r46dbef180aa54dea86c244726d1311a1""",
            "rc51bf558a7b44e3c8ba761d8fbf621b3""",
            "r7acc373e8bbc45af80c3628b36b607d2""",
            "rcddb3b37efea4b0581380286e2a58c43""",
            "re6399ebf08144a2f80bdaf1cef4c9e68""",
            "r74fd6343975f469399209f889d560f90""",
            "r053f53e6f2b44ef689d310778a0343e7""40",
            "r9fb13db0ff154108bff1a2c9b427d634""",
            "rfb90a16e669a44dcb32b42878b3d238d""",
            "rf9aa20e446ca4f17a5000daa87d3427b""",
            "r74c0785c8b4b4473af22f53d76590683""",
            "r8c803ec19fa9401fae810d08f4b2d397""30",
            "r3176851c3f014235a381b26eb16e5c9f""",
            "rcdfbd1e7603e4cb3a9fdce9918aee729""",
            "r965efa621bfb48b6af0fb1c7243dcd0c""NY",
            "rbddfd1e712b44d0583e17091dacd774f""",
            "r60e6f6c0b03645c88bb163badb05127b""40",
            "ra938b483738740e08beb5caa1d4c59c7""",
            "r61be24f662fb4426ae6ac25efbf04cb0""30",
            "rdddd20438bba4c779370f339bfa25ac9""100",
            "rc3748435c0e94d09baa1d38a9cc67645""",
            "rb4a02f93bd5648729fd90697a5f834e9""",
            "rc9d5167631174780ae3b8bbf409e4a4b""",
            "rfd9dbdb46e5349789de0af8b0b43c0b6""40",
            "re3a439c4a68b4e958181eb73f3992392""",
            "r23f727504e524dde9fc9234f750aea4f""",
            "r501a16e25b4e421298ce3acf58aa5841""",
            "r4bb3b09163284646af53baebcd84f0f7""",
            "r0ed647676ded45158082fdb1652657a7""",
            "r44db590ecc8e456490f8fd41c6bc0433"""
        }
    }
  • PB-03031956-0 Profile Picture
    6 on at
    think I have it now, thanks for the help

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 377

#2
11manish Profile Picture

11manish 279

#3
David_MA Profile Picture

David_MA 234 Super User 2026 Season 1

Last 30 days Overall leaderboard