Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

Change or insert data to XML variable in Workflow

Avatar

Former Community Member
Hi,



In a workflow, there is a XML variable with the following data:

<data>

<current_user>

<username>apink</username>

</current_user>

<current_user>

<username>tblue</username>

</current_user>

<current_user>

<username>vkarven</username>

</current_user>

</data>



How to change the data for 'username'. I tried

'/process_data/MyXML/data/current_user[3]/username' = "kelvin", but does not work. I tried many other combinations and none of it works. Look simple, yet can't get it work?



Also, how can I add a 4th new 'current_user' to the XML?



Thanks for help...
6 Replies

Avatar

Former Community Member
Try

/process_data/MyXML/data/current_user[number(3)]/username

if this does not work, then it is not possible to add a new 4th user, email me @ mergeandfuse@gmail.com, may be I can give you something

Avatar

Former Community Member
Thanks... I tried your suggestion, did not work...

Avatar

Former Community Member
Were you guys able to figure out how to update a specific node in an XML in the workbench process? Any help is highly appreciated. Thanks!

Avatar

Level 10
I ran into similar issues a while ago trying to do the same thing. I couldn't figure it out. I had to build a custom component and/or script service to get around the issue.



I tried it with the Alpha version of LiveCycle 8.2 and it seems to be fine. It could be a bug with the current version.



You can check with support at otsupp@adobe.com



Sorry.



Jasmin

Avatar

Former Community Member
I was able to do it in a Set Value operation with the following



Location Expression

(/process_data/MyXML/data/current_user[3])/username "kelvin"



Hope that helps.

Avatar

Former Community Member
You can make string out of this XML. Manipulate that string - add a new user and put that string back to XML variable. I did implement the same in my process as an workaround.