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 / XML in flow and then o...
Power Automate
Answered

XML in flow and then output to SharePoint list

(0) ShareShare
ReportReport
Posted on by 60
Hi,

i have such Parse JSON output which looks like that. Now I want to use "Create item" to create list items and fill it with the value from that XML file. How can I call by expression or so these values, how to write it, so simple things like
item().Technician or so does not work and it want the value but also in a way that it graps the correct named value. 
 
{
    "body": {
        "?xml": {
            "@version": "1.0",
            "@encoding": "UTF-8"
        },
        "form": {
            "fields": {
                "field": [
                    {
                        "@name": "Technician",
                        "value": "False"
                    },
                    {
                        "@name": "Optical",
                        "value": "False"
                    },
                  and so on 
Categories:
I have the same question (0)
  • Suggested answer
    David_MA Profile Picture
    12,982 Super User 2025 Season 2 on at
    XML data is not the easiest to work with. I have seen people get the data out of XML in different ways, but this is how I do it:
    1. In the above, my XML data is coming from a repeating section in a SharePoint list item. I pass the field that stores this data through a Compose action.
    2. I add a second Compose action and use this expression to convert the XML to JSON: json(xml(outputs('Compose_Shipment_Items')))
    3. The expression in both the "Compose Array or Object" action and the Condition is the same. This checks if there is more than 1 item of data in the XML. The expression is length(array(outputs('Compose_JSON')?['RepeaterData']?['Items']?['Item']))
    How you process the next steps depends on the condition and whether it is an array or an object and the scheme for the Parse JSON differs depending on the type.
     
    To generate the scheme, you will need to run your flow and copy the output from the Compose JSON action. You can then use the Generate from sample button to generate the scheme. Once you get this far, you can then use JSON Path expressions to get the values from the data. For example: body('Parse_JSON_Object')?['RepeaterData']?['Items']?['Item']?['_c4339a4041ac4f57b5090126c36084d8']?['#text'] when there is one item or items('Apply_to_each_Item')?['_c4339a4041ac4f57b5090126c36084d8']?['#text'] when it is an array with multiple items using the expression builder.
     
    You might find this resource helpful for writing the JSON Path expressions: 2 Ways to Get a Value from a JSON Object in Power Automate - Power Tech Tips
     
  • mjp1973 Profile Picture
    60 on at
    Thanks for your help

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 507 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 267 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard