Best practices for array variables and handling data in flows

Copper Contributor

Hey all,

 

I'm mostly self taught in programming, Flow, etc... so pardon my ignorance.

What is the best way to handle array data and variables in a flow? Such as an array, or a key:value pair array and be able to reference that later in the flow.

 

For example, I have a doc parsed, and I extract some 32 values into an array.

I want to reuse those values in other parts of the flow, but I don't want to have to remember which part in the array it is, and having it stored as dynamic content or a friendly variable would be helpful, as opposed to writing expressions out as variables('thisisanarray')[17], or creating 32 'Initialize Variable' tasks.

 

Here I (slightly painstakingly) took the parts of the array I want to use and put them into an Object variable (not sure if this is the right move).

 

breadwise_gamgee_0-1611678324931.png

I'd like to use these in other connections like Planner, Teams, Sharepoint, etc.

 

I notice if I follow this Object with a ParseJson it gives the variables nice friendly names. But it each time I use one of the Json variables it puts that action into an "Apply to Each" loop which is inconvenient, kinda messy. (I also know little about JSON or how to use it)

breadwise_gamgee_2-1611679775772.png

 

 

Is there a better way to do this?
Should I skip the Table Object and JSON parsing and just add the array variable I want to use directly into a connection (like a Sharepoint list) and use the Dynamic Content from the Sharepoint list?

      Array > Sharepoint list > (Teams, Planner, etc...)

versus

      Array > Object > Parse JSON > (Sharepoint, Teams, Planner, etc)

 

Any suggestions welcome.

0 Replies