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
Super User III
Super User III

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.

Jcook
Super User III
Super User III

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.

Jcook
Super User III
Super User III

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

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

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,432)