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

Extract data from Body in order to put it in SP list

Hi Guys!

I have a massage in my Flow with below Body:

{
  "id""a2003c133492cf46d65d0584a9e3d00a",
  "document_id""eb3bd8476f7d2480355ca9642e60ad34",
  "remote_id""",
  "file_name""scan0017",
  "page_count"1,
  "uploaded_at""2020-06-10T07:54:57+00:00",
  "processed_at""2020-06-10T07:55:40+00:00",
  "kvittonr""169670",
  "datum": {
    "match""2017-07-31",
    "iso8601""2017-07-31"
  },
  "total"null,
  "moms""5,86",
  "netto""23,20",
  "adress""Jula Skovde\n\nJonstorpsgatan 25, 54166 Skovde\n\nSe556944785601\nTelefon: 0511~342000\n\nKund 073725761\nHosseini Iman\n\nI St 120650\nSag 550 MM\n\n19,00"
}
 
How I can extract only some info like "moms": "5,86" in order to put in the right column in my SP list ? 
 
1 ACCEPTED SOLUTION

Accepted Solutions
v-bacao-msft
Community Support
Community Support

 

Hi @Iman ,

 

You could use Parse JSON action to parse the body and fill the Dynamic content in the specified field.

41.PNG

{
    "type": "object",
    "properties": {
        "id": {
            "type": "string"
        },
        "document_id": {
            "type": "string"
        },
        "remote_id": {
            "type": "string"
        },
        "file_name": {
            "type": "string"
        },
        "page_count": {
            "type": "integer"
        },
        "uploaded_at": {
            "type": "string"
        },
        "processed_at": {
            "type": "string"
        },
        "kvittonr": {
            "type": "string"
        },
        "datum": {
            "type": "object",
            "properties": {
                "match": {
                    "type": "string"
                },
                "iso8601": {
                    "type": "string"
                }
            }
        },
        "total": {},
        "moms": {
            "type": "string"
        },
        "netto": {
            "type": "string"
        },
        "adress": {
            "type": "string"
        }
    }
}

If you cannot get the dynamic content when you configuring the number field, you could use Compose to get the dynamic content and fill the output of the compose in number field.

 

Best Regards,

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

View solution in original post

3 REPLIES 3
efialttes
Super User
Super User

Hi!

Let's assume you add an 'Initialize a variable' action block, lets call it 'myInputObject', type object, assign this body as its value.

Now, if you wanna access 'moms' attribute value, I would assign the following WDL expression to your SP column input:

 

variables('myInputObject')?['moms']

 

If you are not famiiar with WDL expressions, please follow these steps:

https://flow.microsoft.com/es-es/blog/use-expressions-in-actions/

Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



v-bacao-msft
Community Support
Community Support

 

Hi @Iman ,

 

You could use Parse JSON action to parse the body and fill the Dynamic content in the specified field.

41.PNG

{
    "type": "object",
    "properties": {
        "id": {
            "type": "string"
        },
        "document_id": {
            "type": "string"
        },
        "remote_id": {
            "type": "string"
        },
        "file_name": {
            "type": "string"
        },
        "page_count": {
            "type": "integer"
        },
        "uploaded_at": {
            "type": "string"
        },
        "processed_at": {
            "type": "string"
        },
        "kvittonr": {
            "type": "string"
        },
        "datum": {
            "type": "object",
            "properties": {
                "match": {
                    "type": "string"
                },
                "iso8601": {
                    "type": "string"
                }
            }
        },
        "total": {},
        "moms": {
            "type": "string"
        },
        "netto": {
            "type": "string"
        },
        "adress": {
            "type": "string"
        }
    }
}

If you cannot get the dynamic content when you configuring the number field, you could use Compose to get the dynamic content and fill the output of the compose in number field.

 

Best Regards,

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

View solution in original post

@Iman 

Did you have time to review the suggestions posted? Do any of them match your expectations?

 

If so, do not forget to mark this topic as "Solved" by clicking "Accept as a solution". Such an action is key for our community, since this way others facing a similar problem can find a solution faster!

 

Please also note you can even select several responses as solution, even from different community members!

 

Flow_AcceptSolution.png

Thankx for your help making this community great!



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (2,966)