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

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

Parsing XML via JSON to SP

(0) ShareShare
ReportReport
Posted on by 160

Hi Community,

 

I searched a lot but didn't succeed to find how to convert my XML files to my Sharepoint List.

 

First I convert to JSON, then parse the JSON output. The structure allows direct allocation to my sharepoint columns for most of the items, but the "property/value" should come to each SP column with the same name as the "property/key". I hope I could explain my issue.

 

Thanks for your help,

Paul

 

polo1604_0-1647984897986.png

 

I have the same question (0)
  • KvB1 Profile Picture
    1,596 on at
    Re: Parsing XML via JSON to SP

    Hi, 

     

    Are these supposed to be in the same list item where the key indicates the column for that item, or are they different list items where you want to fill that specific column?

    For example, 

  • polo1604 Profile Picture
    160 on at
    Re: Parsing XML via JSON to SP

    Hi,

     

    thanks for your reply. The columns to fill are following:

     

    type:

    source:

    time:

    mileage:

    heading:

    speed:

    LACY:

    LPOST:

    LLAT:

     

    this means I need to unnest the property values, and put them in the right column based on the property/key value.

     

     

  • KvB1 Profile Picture
    1,596 on at
    Re: Parsing XML via JSON to SP

    What kind of a type is the property?

    If the position of those values is fixed within "property" I think you should be able to just grab them with the select action, and then use the output of that to fill your rows

  • polo1604 Profile Picture
    160 on at
    Re: Parsing XML via JSON to SP

    Hi,

    I never did that with select, could you please show me how this should look like?

     

    thanks a lot for your help!

     

  • KvB1 Profile Picture
    1,596 on at
    Re: Parsing XML via JSON to SP

    Could you post the schema of the parse JSON?

  • polo1604 Profile Picture
    160 on at
    Re: Parsing XML via JSON to SP

    here we are:

     

    {
      "type""object",
      "items": {
        "type""object",
        "properties": {
          "type": {
            "type""string"
          },
          "source": {
            "type""string"
          },
          "time": {
            "type""string"
          },
          "mileage": {
            "type""string"
          },
          "heading": {
            "type""string"
          },
          "speed": {
            "type""string"
          },
          "property": {
            "type""array",
            "items": {
              "type""object",
              "properties": {
                "key": {
                  "type""string"
                },
                "value": {
                  "type""string"
                }
              },
              "required": [
                "key",
                "value"
              ]
            }
          },
          "coordinate": {
            "type""object",
            "properties": {
              "latitude": {
                "type""string"
              },
              "longitude": {
                "type""string"
              }
            }
          }
        },
        "required": [
          "type",
          "source",
          "time",
          "mileage",
          "heading",
          "speed",
          "property"
        ]
      }
    }
  • KvB1 Profile Picture
    1,596 on at
    Re: Parsing XML via JSON to SP

    I am not very good with JSON 😞

    But I think that you could create a select action, and use the parse JSON as input. If the objects in the property array are expected to be in the same order, you would then be able to define the key (such as LACY) during the select action, and give it a value based on the number of the object in the array.

     

    For example, for LACY you could use a value like: ('property')[0]?['value']

  • polo1604 Profile Picture
    160 on at
    Re: Parsing XML via JSON to SP

    The objects in the property array are not always the same nor they are in the same order.

     

    That's why I'm looking for a way to read the value out of property/key (such as LACY) to define where the value from Property/value has to be stored in.

     

    something like this:

     

    LACY: if(property/key='LACY', property/value)

     

  • polo1604 Profile Picture
    160 on at
    Re: Parsing XML via JSON to SP

    Hello Community,

     

    nobody has an idea? There should be a solution but I will not find it alone...!

  • polo1604 Profile Picture
    160 on at
    Re: Parsing XML via JSON to SP

    Hello,

     

    I'm still struggling with my XML. Could anyone show how I could iterate trough all "property" nodes? Maybe this could help to analyze tha data.

     

    Thanks for your help

    Paul

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

Coming soon: forum hierarchy changes

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

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 535 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 348 Moderator

#3
developerAJ Profile Picture

developerAJ 262

Last 30 days Overall leaderboard