I have an XML variable "myXML" which is set to:
Question - within an Execute script, how can I easily access and update the second node value? i.e. change "b" to "c"
The following fails in Execute Script (although it is possible using an XPath expression in a SetValue
If I have square brackets in this expression then it fails with a nasty error
Is there an easy way?
No need of ExecuteScript activity for this simple assignment.
You can try this XPATH expression:
and the value is "c"
Please note that the node index starts from 1,2 and so on.
Thanks Nith ... I know I can do this with a SetValue.
But I need to do it inside an Execute Script call .. it's part of logic (loops, conditions etc), that are much too big and complex to use regular tasks in a process...
This is running in a script of 80 or so lines of code ....
Is it possible?
I tired your script in my sandbox and its working fine without fail.
I noticed an additional space in your xpath expression
Can you remove the space within node tag and try again?
Really? Because I get a nasty error "Internal error"
It's not working at all on two systems.
And sorry, that pace was a copy / paste problem .. it's not in my code....