web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Parse JSON into multip...
Power Automate
Unanswered

Parse JSON into multiple records to create item in Sharepoint

(0) ShareShare
ReportReport
Posted on by 28

Hello

 

I am looking to parse JSON from a payment provider and populate into a SharePoint list. I have successfully gotten the JSON but am having trouble getting each record into SharePoint. I have created one record with blank information.

 

JSON schema:

 

{
 "type": "object",
 "properties": {
 "object": {
 "type": "string"
 },
 "id": {
 "type": "string"
 },
 "amount": {
 "type": "integer"
 },
 "amount_refunded": {
 "type": "integer"
 },
 "application": {},
 "application_fee": {},
 "application_fee_amount": {},
 "balance_transaction": {
 "type": "string"
 },
 "billing_details": {
 "type": "object",
 "properties": {
 "address": {
 "type": "object",
 "properties": {
 "city": {},
 "country": {},
 "line1": {},
 "line2": {},
 "postal_code": {},
 "state": {}
 }
 },
 "email": {},
 "name": {
 "type": "string"
 },
 "phone": {}
 }
 },
 "calculated_statement_descriptor": {},
 "captured": {
 "type": "boolean"
 },
 "created": {
 "type": "integer"
 },
 "currency": {
 "type": "string"
 },
 "customer": {},
 "description": {
 "type": "string"
 },
 "disputed": {
 "type": "boolean"
 },
 "failure_code": {},
 "failure_message": {},
 "fraud_details": {
 "type": "object",
 "properties": {}
 },
 "invoice": {},
 "livemode": {
 "type": "boolean"
 },
 "metadata": {
 "type": "object",
 "properties": {
 "uuid": {},
 "webform": {},
 "webform_id": {},
 "webform_submission_id": {},
 "course": {},
 "offering": {},
 "company": {},
 "phone": {}
 }
 },
 "on_behalf_of": {},
 "order": {},
 "outcome": {},
 "paid": {
 "type": "boolean"
 },
 "payment_intent": {},
 "payment_method": {
 "type": "string"
 },
 "payment_method_details": {
 "type": "object",
 "properties": {
 "card": {
 "type": "object",
 "properties": {
 "brand": {
 "type": "string"
 },
 "checks": {
 "type": "object",
 "properties": {
 "address_line1_check": {},
 "address_postal_code_check": {},
 "cvc_check": {
 "type": "string"
 }
 }
 },
 "country": {
 "type": "string"
 },
 "exp_month": {
 "type": "integer"
 },
 "exp_year": {
 "type": "integer"
 },
 "fingerprint": {
 "type": "string"
 },
 "funding": {
 "type": "string"
 },
 "installments": {},
 "last4": {
 "type": "string"
 },
 "network": {
 "type": "string"
 },
 "three_d_secure": {},
 "wallet": {}
 }
 },
 "type": {
 "type": "string"
 }
 }
 },
 "receipt_email": {},
 "receipt_number": {},
 "receipt_url": {
 "type": "string"
 },
 "refunded": {
 "type": "boolean"
 },
 "refunds": {
 "type": "object",
 "properties": {
 "object": {
 "type": "string"
 },
 "data": {
 "type": "array"
 },
 "has_more": {
 "type": "boolean"
 },
 "url": {
 "type": "string"
 }
 }
 },
 "review": {},
 "shipping": {},
 "source_transfer": {},
 "statement_descriptor": {},
 "statement_descriptor_suffix": {},
 "status": {
 "type": "string"
 },
 "transfer_data": {},
 "transfer_group": {}
 }
}

 

 Overall FlowOverall Flow

Expansion of parsing and creating an arrayExpansion of parsing and creating an array

The Get items obtains values from the current SharePoint list. The conditions looks at if the item is already in the SharePoint list. These seem to be working.

Populating sharepoint listPopulating sharepoint list

 

 

Categories:
I have the same question (0)
  • tlevine Profile Picture
    230 on at

    I am looking to do the same thing - hope to have some insight from the community here! 🙂 @lokeshpatel 

  • v-alzhan-msft Profile Picture
    on at

    Hi @lokeshpatel ,

     

    You needn't to create array for the items, just apply to each record from the Body output of the Parse JSON action as my screenshot below:

    1.png

     

    Best Regards,

    Alice

     

    Community Support Team _ Alice Zhang
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • tlevine Profile Picture
    230 on at

    hi @v-alzhan-msft - I receive the following error message when following the steps you outlined below. 

     

    Any recommendations on how to resolve?

     

    Screen Shot 2020-05-17 at 11.33.59 PM.png

  • v-alzhan-msft Profile Picture
    on at

    Hi @tlevine ,

     

    Could you please share the screenshot of your flow?

     

    Best Regards,

    Alice

     

    Community Support Team _ Alice Zhang
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • tlevine Profile Picture
    230 on at

    Please see the attached documentation @v-alzhan-msft Capture.PNG

  • v-alzhan-msft Profile Picture
    on at

    Hi @tlevine ,

     

    I need the screenshot of the configuration of the flow.

    And Since the flow is failed at the Create item action, please take a try get the column value, save it in the Compose to see if it works.

     

    Best Regards,

    Alice

     

    Community Support Team _ Alice Zhang
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • tlevine Profile Picture
    230 on at

    @v-alzhan-msft  - can you clarify both of the points you mentioned?

  • v-alzhan-msft Profile Picture
    on at

    Hi @tlevine ,

     

    First, flow screenshot in edit mode.

    Second, troubleshooting the Get items action, don't add item to the list, just add the column value in a Compose.

     

    Best Regards,

    Alice

     

    Community Support Team _ Alice Zhang
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • tlevine Profile Picture
    230 on at

    Hi - I was able to complete this without having to use a flow, but rather a simple patch statement with my gallery

     

    ForAll(
     Gallery3_1.AllItems,
     Patch(
     'Shortage Report',
     Defaults('Shortage Report'),
     {
     Site: site1.Text,
     PWD: pwd1.Text,
     'Request Status': "Open",
     'Submitted By': varUser,
     'Submitted Date': varToday,
     'WIP DU': wipdu1.Text,
     'Cases Required': cs1.Text,
     'FG DU': fgdu1.Text,
     'Multiple DU Indicator': multdu1.Text
     }
     )
    )

     

     

  • lokeshpatel Profile Picture
    28 on at

    Hi @v-alzhan-msft 

     

    When I do this, it gives me an error at the Apply to each:

    The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@body('Parse_JSON_3')' is of type 'Object'. The result must be a valid array.

     

    One thing to note is that my JSON currently has 3 records. It is listed as:

     

    {
     "object": "list",
     "data": [
     {
     "id": "XXXXXXXXXXXXXXXXXX",
     "object": "XXXXXXXXXX",

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard