Before we jump into the above three actions of PAD, I would like to share the XML file. In order to know more about XML attributes, refer to this link.
<?xml version="1.0" encoding="UTF-8"?>
<bookstore>
  <book>
    <title lang="en">Harry Potter</title>
    <price currency="INR">29.99</price>
  </book>
  <book>
    <title lang="en">Learning XML</title>
    <price currency="HKD">39.95</price>
  </book>
  <book>
    <title lang="en">Flexmind PowerApps</title>
    <price currency="USD">49.95</price>
  </book>
</bookstore>
In the above example I am using currency attribute of price element. Let’s start !!
Get XML Element Attribute
This action get the value of an attribute of an XML element. For example, let us consider this below piece of code. Here currency is an attribute for price element which value is INR.
<price currency="INR">29.99</price>
Flow
Get Attribute
Parameters explanation
XML Document : Variable coming from read XML file action. XPath query: /bookstore/book[%input1%]/price. Here [%input1%] is basically a variable which value is equal to user input (an integer). Attribute Name: Currency Get Value as: Text Value
Now run the flow to see the result. It will look like below picture.
Display Result
Set XML Element Attributes
We use this action to set the value of an attribute. If you see the below picture, set XML’s parameters pretty similar to Get action. Suppose, if we want to set the currency from INR to SGD, then we will use the Set action.
Set Attribute
Remove XML Element Attribute
If you want to remove the attribute of an XML element, then in that case you will use this action. Parameters for this action is also very similar to Set and Get actions.
Hope you all will enjoy this article. So stay tuned.
When you login first time using a Social Login button, we collect your account public profile information shared by Social Login provider, based on your privacy settings. We also get your email address to automatically create an account for you in our website. Once your account is created, you'll be logged-in to this account.
DisagreeAgree
Connect with
I allow to create an account
When you login first time using a Social Login button, we collect your account public profile information shared by Social Login provider, based on your privacy settings. We also get your email address to automatically create an account for you in our website. Once your account is created, you'll be logged-in to this account.
DisagreeAgree
2 Comments
Oldest
NewestMost Voted
Inline Feedbacks
View all comments
manos
4 years ago
Hi there!
Thank you for the article, it has been very helpful 🙂
I’ve got a question though. How would we be able to get multiple element attributes from the same xml file? i.e. if my xml looks like this:
Sorry, I am unable to see your xml file, guess you have provided a screenshot. Can you paste your xml code in the comment box? Also, in order to get multiple element attributes, you can iterate inside a loop.
Hi there!
Thank you for the article, it has been very helpful 🙂
I’ve got a question though. How would we be able to get multiple element attributes from the same xml file? i.e. if my xml looks like this:
how would I get each “FileUrl Attribute?”
Sorry, I am unable to see your xml file, guess you have provided a screenshot. Can you paste your xml code in the comment box? Also, in order to get multiple element attributes, you can iterate inside a loop.
Thanks,
Rakesh