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 / xpath and xml help needed
Power Automate
Unanswered

xpath and xml help needed

(0) ShareShare
ReportReport
Posted on by

WORKING

I have a working process with a similar thing I want to get working so I used this as a starting point

Process that works... 

1) Get items in sharepoint

2) apply to each

   a) append to an array

        Details...

          {

              "Title": ": items('Apply_to_each')?['Title']},

              "Systems": join(xpath(xml(json(concat('{"body":{"value":', items('Apply_to_each')?['Systems'], '}}'))), '/body/value/Value/text()'), ', ')

           }

 

This works.. Systems is a multiselect sharepoint choice column

 

This is what I want to do...
1) get Items from sharepoint
2) compose to union an array variable with the array VALUES obtained from the get items (as I will have to get multiple get items)
3) stores in a variable (call it "Catch all").. 1,2,3 are looped through several times appending to the same array variable. 
4) then i take the completed Catch all and do a select "Select" to form the Json..
  • Title = item()?['Title'} and so on..
  • for Systems I did every syntax combination I can think of.. with this being what I think is the closest to working.
    • join(xpath(xml(json(item()?['Systems'])), '/Value/text()'), ', ')
which systems join expression yields an error of "'The template language function 'json' expects its parameter to be a string or an XML. The provided value is of type 'Array'. Please see https://aka.ms/logicexpressions#json for usage details.'."
 
Please note that the output of the array variable is a Json that doesnt have a "body" with "values" structured underneath
Instead of:
  • "body"
    • "value"
      • [0]
        • "Systems": [
          {
          • "@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
          • "Id": 0,
          • "Value": "abc"
            },
            {
          • "@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
          • "Id": 5,
            "Value": "xyz"
            }
            ], etc with other different items
      • [1]
        • repeated
 
Its simply: (no "body" or "value" levels)
  • [0]
    • "Systems": [
      {
      • "@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
      • "Id": 0,
      • "Value": "abc"
        },
        {
      • "@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
      • "Id": 5,
        "Value": "xyz"
        }
        ], etc with other different items
  • [1]
    • repeated
 
Any help would be much appreciated
Categories:
I have the same question (0)
  • Matthy79 Profile Picture
    4,180 Super User 2024 Season 1 on at

    Hello @jimi_hendrix 

     

    so create the „body“ (root) for your xml on your own like you did it in the already working process.

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

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard