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

populate SharePoint from JSON array

Hello,

i need help for the below scenario.

i used an output variable(CNP_Extract) to get the data from PAD (which is in form of a table, fields: Received Date, Account No, Debit Date, Payer Name, PI Type, Curr, Debit Amount) to cloud flow.

After parsing the output, the JSON is like this

"CNP_Extract""Received Date, Account No, Debit Date, Payer Name, PI Type, Curr, Debit Amount\r\n28/10/2020, 9999999999999, 28/10/2020, XX00_NOTMUR, LTP, USD, 500\r\n
i need to get the JSON into the correct array format so that i can populate the SharePoint.
2 REPLIES 2
Ougesh
Frequent Visitor

DamoBird365
Super User
Super User

HI @Ougesh 

 

Here's the basic idea.

 

Split on the return line \r\n and then use select to split again on the delimiter.  Then remove the last object via a filter is not equal to nothing.  You can either manually specify the key name OR use a dynamic expression by retrieving the first object of the original array.

 

DamoBird365_2-1633462926052.png

 

FROM skskip(body('Filter_array'),1)

KEY split(first(outputs('Split')),',')[0]  then 1,2,3,4

VALUE split(item(),',')[0] then 1,2,3,4

 

The output is :

DamoBird365_1-1633462693642.png

 

You can sort leading or trailing spaces with trim() i.e. trim(split(first(outputs('Split')),',')[0])

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Cheers,
Damien


P.S. take a look at my new blog here and like & subscribe to my YouTube Channel thanks 😉

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Top Kudoed Authors
Users online (3,823)