Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Store Event XML in Instance Variable

chrisr17787094
Level 2
Level 2

Hi there

I am trying to understand how I extract an XML data node and store it within an instance variable inside a workflow. I've tried looking everywhere for help on how to do this but cannot find anything. I have limited JS knowledge but am assuming this must be possible somehow. Below are some examples of the XML and what I am currently trying within the workflow. Any help would be appreciated.

XML looks like this:

<ctx>

      <UUID>cab2ed30-4864-439b-a2bf-73ec5a42ff17</UUID>

      <CUSTOMERNAME>Mr 238396</CUSTOMERNAME>

      <POLICYNUMBER>ABC123456</POLICYNUMBER>

      <COVER_START>18-04-2018</COVER_START>

      <COVER_END>17-04-2019</COVER_END>

     </ctx>

Then within a JavaScript code node I have this:

var ctx = XML(ams.<companyname>MessagingEventQueue.ctx);

instance.vars.custName = ctx.CUSTOMERNAME;

Cheers

Chris

0 Replies