Best practices for array variables and handling data in flows

%3CLINGO-SUB%20id%3D%22lingo-sub-2098559%22%20slang%3D%22en-US%22%3EBest%20practices%20for%20array%20variables%20and%20handling%20data%20in%20flows%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2098559%22%20slang%3D%22en-US%22%3E%3CP%3EHey%20all%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20mostly%20self%20taught%20in%20programming%2C%20Flow%2C%20etc...%20so%20pardon%20my%20ignorance.%3C%2FP%3E%3CP%3EWhat%20is%20the%20best%20way%20to%20handle%20array%20data%20and%20variables%20in%20a%20flow%3F%20Such%20as%20an%20array%2C%20or%20a%20key%3Avalue%20pair%20array%20and%20be%20able%20to%20reference%20that%20later%20in%20the%20flow.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFor%20example%2C%20I%20have%20a%20doc%20parsed%2C%20and%20I%20extract%20some%2032%20values%20into%20an%20array.%3C%2FP%3E%3CP%3EI%20want%20to%20reuse%20those%20values%20in%20other%20parts%20of%20the%20flow%2C%20but%20I%20don't%20want%20to%20have%20to%20remember%20which%20part%20in%20the%20array%20it%20is%2C%20and%20having%20it%20stored%20as%20dynamic%20content%20or%20a%20friendly%20variable%20would%20be%20helpful%2C%20as%20opposed%20to%20writing%20expressions%20out%20as%26nbsp%3B%3CSTRONG%3Evariables('thisisanarray')%5B17%5D%3C%2FSTRONG%3E%2C%20or%20creating%2032%20'%3CSTRONG%3EInitialize%20Variable%3C%2FSTRONG%3E'%20tasks.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHere%20I%20(slightly%20painstakingly)%20took%20the%20parts%20of%20the%20array%20I%20want%20to%20use%20and%20put%20them%20into%20an%20Object%20variable%20(not%20sure%20if%20this%20is%20the%20right%20move).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22breadwise_gamgee_0-1611678324931.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F249551iA1E552AF3CBA09F2%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22breadwise_gamgee_0-1611678324931.png%22%20alt%3D%22breadwise_gamgee_0-1611678324931.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EI'd%20like%20to%20use%20these%20in%20other%20connections%20like%20Planner%2C%20Teams%2C%20Sharepoint%2C%20etc.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20notice%20if%20I%20follow%20this%20Object%20with%20a%20ParseJson%20it%20gives%20the%20variables%20nice%20friendly%20names.%20But%20it%20each%20time%20I%20use%20one%20of%20the%20Json%20variables%20it%20puts%20that%20action%20into%20an%20%22Apply%20to%20Each%22%20loop%20which%20is%20inconvenient%2C%20kinda%20messy.%20(I%20also%20know%20little%20about%20JSON%20or%20how%20to%20use%20it)%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22breadwise_gamgee_2-1611679775772.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F249559i382B4E80FCCE9524%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22breadwise_gamgee_2-1611679775772.png%22%20alt%3D%22breadwise_gamgee_2-1611679775772.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20there%20a%20better%20way%20to%20do%20this%3F%3CBR%20%2F%3EShould%20I%20skip%20the%20Table%20Object%20and%20JSON%20parsing%20and%20just%20add%20the%20array%20variable%20I%20want%20to%20use%20directly%20into%20a%20connection%20(like%20a%20Sharepoint%20list)%20and%20use%20the%20Dynamic%20Content%20from%20the%20Sharepoint%20list%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20Array%20%26gt%3B%20Sharepoint%20list%20%26gt%3B%20(Teams%2C%20Planner%2C%20etc...)%3C%2FP%3E%3CP%3Eversus%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20Array%20%26gt%3B%20Object%20%26gt%3B%20Parse%20JSON%20%26gt%3B%20(Sharepoint%2C%20Teams%2C%20Planner%2C%20etc)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAny%20suggestions%20welcome.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2098559%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EMicrosoft%20Flow%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Occasional Visitor

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