cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dgoguet
Frequent Visitor

JSON string for Http request

Hi,

I'm currently building a flow that send an http query to an external API based on the results of a Sharepoint form.

My main question is about a field that accepts multiple values.

How can I generated an item with 1 or more values?

Example:

My list has items Item1, Item2, Item3 whith checkbox.

If Item1 only is checked, I'd like:

Item {

    "Item1"

}

 

If Item1 and Item3 are checked, I'd like:

Item {

    "Item1",

    "Item3"

}

 

Thanks in advance for your suggestions!

1 ACCEPTED SOLUTION

Accepted Solutions
Pstork1
Dual Super User III
Dual Super User III

Some of this depends on the JSON schema format that the API is expecting.  But based on your example I think the answer is that you have to format the JSON as an Array, even if there is only one item.  Note the use of the square brackets for an array. Something like this if there is only one item.

Item {

   [ "Item1"]

}

and this for multiple items.

Item {

   [ "Item1",

    "Item3" ]

}

 



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

2 REPLIES 2
Pstork1
Dual Super User III
Dual Super User III

Some of this depends on the JSON schema format that the API is expecting.  But based on your example I think the answer is that you have to format the JSON as an Array, even if there is only one item.  Note the use of the square brackets for an array. Something like this if there is only one item.

Item {

   [ "Item1"]

}

and this for multiple items.

Item {

   [ "Item1",

    "Item3" ]

}

 



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

dgoguet
Frequent Visitor

You're right, I think it's the way I should experiment 😉

Thanks!

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (1,031)