How to import xml activities

Hey there team, i have imported Systmem.XML.Serialization, Systmem.XML.Serialization.Configuration, Systmem.XML.XMLConfiguarion and i don’t see the activity I’m trying to use which is “Deserealize XML”. I’m basically trying to use an xml file as a config file and read values to pass into my bot. All the help will be appreciated.
Thanks!

Hi @IngridJB

Go to manage package

And type UiPath.Web.Activities and install the package

You LL get the activities listed

Thanks
Ashwin.S

2 Likes

thank you, got the activities!!

ok so before this closes I ran into another issue. I was able to install the package above. I have an xml file which im testing just to see how I can use it as a config file

  1. The file contents are the following:
  <configuration>
     <username>jfdljfdjfdljf</username>
     <password>fdjlfdjlfjdl</password>
</configuration>
  1. I used a deserialize activity

  2. Then I used the For Each workflow activity and entered the Type Argument and Value in the screenshot below:

  3. I try to message box the value of username, like below
    messageBox

  4. but I get the following message
    configException

Appreciate your help!!

Fine to the xml Activities we neee to download
Uipath.Web.Activities – fine we go that now
–next to get the values of each element we need to use deserialize xml ACTIVITY which wil convert the xml to xml document and get the output with a variable named out_xml
–next here to get the value of username and password we need to mention like this
Out_username = out_xml.Elements(“Configuration”).Elements(“username”). ToString
Similarly for password
Out_password = out_xml.Elements(“Configuration”).Elements(“password”). ToString

Try this and let know buddy
Hope this would help you
Cheers @IngridJB

@Palaniyappan is the TypeArgument correct in the For Each loop?

1 Like

Also, where do I write/ which activity do I use–do I use the Assign activity?: Out_username = out_xml.Elements(“Configuration”).Elements(“username”). ToString

Thank you!

1 Like

Yes In assign Activity itself buddy, here as we have only two values to be obtained, we can simply use a assign activity
If there are more in numbers then we can use for each lool with type argument as
System.xml.Linq.XElement

For more info on this Kindly have a view on this buddy

Cheers @IngridJB

yea I did that and I still get the same error message

Capture

Fine
Is that the root element or.
Is there any other element as root before this configuration
Cheers @IngridJB

“configuration” is the only root element

Hi @IngridJB

Use this code inside for each activity

Print the values

Thanks
Ashwin.S

Well then it should work Actually buddy
Strange…!
Fine
Can u have a view on your xaml if possible
Cheers @IngridJB

Hey there @AshwinS2 and @Palaniyappan , I was able to solve the issue. This is what I did:
Capture

fantastic
Cheers @IngridJB