Parse concatenated data source into two variables

Gold Contributor
Gold Contributor
I have a utag_data variable set to event="xyz|100", where 100 is an amount. I want to set a data source to the value of 100, that is, the numbers after the pipe. Suggestions? Thanks.
1 REPLY 1

Parse concatenated data source into two variables

Employee Emeritus
Patrick; there are probably a few ways to do this. My suggestion would be if you are guaranteed that the number you are wanting to retrieve is always after the initial "|" delimiter in the utag.data.event variable , you could use the following in a set data value extension where you set your new variable to (JSCode) utag.data.event.split("|")[1] The screenshot would be an example of this scoped to all tags.
Public