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

Dynamically add a new column to an existing 2D array

I need to dynamically build a 2D array with column names established dynamically and values assigned to each.  I have the flow to find/establish the column names and values.  I can dynamically create this with append to array variables and the output looks like this:

[automated flows

{"FileNumber": "123"},

{"Customer": "Test Company LLC"},

{"LoanAmount": "$100,000.00"}

]

 

I need the output in flat single record so it can be used to populate a sharepoint list with a single expression (example at bottom).  The output should to look like this:

[

{

"FileNumber": "123",

"Customer": "Test Company LLC",

"LoanAmount": "$100,000.00"

}

]

 

So, I need a way to either convert the first output to the second or create the second output dynamically. 

 

Single expression example I am using to populate SharePoint: if(contains(variables('strFieldNames'),'FileNumber'),if(empty(variables('arrEmailResults')[0]['FileNumber']),'',variables('arrEmailResults')[0]['FileNumber']),'')

1 ACCEPTED SOLUTION

Accepted Solutions
JO_SB
Frequent Visitor

10 REPLIES 10
Jcook
MVP

Hello @JO_SB 

 

Could you share a screenshot of your flow.

To better assist, I would like to see how you are getting the above values.

 

Thanks


Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips,
tricks, and guides
FlowAltDelete





JO_SB
Frequent Visitor

Apparently not,  I can't figure out how to upload the screen shots to add it to the post.

JO_SB
Frequent Visitor

1122334455

JO_SB
Frequent Visitor

Sorry for the delay, the weekend took all my attention.  The previous post has the screen shots of the flow you where asking for.  The initialize variable (arrFieldToEmailRelationship) step contains the relevant information to tie the email and the SharePoint list together.

Hello @JO_SB 

 

Is the email that this flow gets triggered on, is the email formatted the same every time?

 

Or can the body of the email be different?


Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips,
tricks, and guides
FlowAltDelete





JO_SB
Frequent Visitor

No, it may be missing lines or have additional lines I don't need and may be in different order.  The only consistency I have is each the data is separated by a line feed and each line has a colon separating the identity from the value.

Thanks @JO_SB 

I know you have posted a example in the first post. But could you post a couple example emails that you would receive.

 


Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips,
tricks, and guides
FlowAltDelete





JO_SB
Frequent Visitor

That information is confidential so I can't post a sample of the email.  But keep in mind I can parse the email with the flow as you see it, so that is not the problem.  I need help getting the parsed info into a SharePoint list.

JO_SB
Frequent Visitor

Anyone come up with a solution to my problem?

JO_SB
Frequent Visitor

Please see this link for an acceptable answer to my problem above.

https://powerusers.microsoft.com/t5/Building-Flows/Changing-an-array/m-p/528899#M67743

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (2,810)