cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
LABORSAL
Advocate II
Advocate II

Convert JSON array to INT array

Hello,

 

I'm currently building a flow which uses a sharepoint list and adaptive cards to collect information via teams and upadate the used list with new data.

 

I ran into a problem with the flow because the list has >1 user responsible and when sending the card it has to be inside a for each, which makes it not possible to use variables (because the variable is cross-updated in the for each causing errors)

 

Due to this situation I changed all variables to composes so it would calculate a different value in the "for each", however when I try to remove the Array variable I'm having more issues than with the strings.

 

The original step did an append to variable of each ID from the sharepoint list and I ended up with an array of ints like this:

 

[
307,
312,
313
]

 

 

I'm currently doing a Select to select the IDs but they come with the "ID" name

 

[
  {
    "ID": 307
  },
  {
    "ID": 312
  },
  {
    "ID": 313
  }
]

 

What I'd need is to convert from the select format to a simple array, does anyone have an idea of how to do that without the use of variables?

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Paulie78
Super User
Super User

Change the select action to text mode by clicking on this:

Paulie78_0-1624294580256.png

Then just put your value only in the map, then you will have a simple array without named elements.

View solution in original post

3 REPLIES 3
Pstork1
Dual Super User
Dual Super User

To convert the JSON array to a simple array you'll need to initialize an array variable and then use an apply to each on the JSON array to append each value to the array variable.



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

Change the select action to text mode by clicking on this:

Paulie78_0-1624294580256.png

Then just put your value only in the map, then you will have a simple array without named elements.

Thanks! such an easy but good solution 😀

Helpful resources

Top Solution Authors
Users online (3,640)