Need to write groovy scripts for insight automation for attribute value action.
I want to extract only JT from John Tom(JT) from Attribute value.
We have two fields attribute1 and attribute2 need to save both values in attribute3 = attribute1 - attribute2
Suppose attribute1 value is John Tom(JT) and attribute2 value is abcd
attribute3 = JT-abcd
Hi,
you could use the regex matcher:
def field1 = "John Tom(JT)"
def field2 = "abcd"
def field3 = (field1 =~ /\(([A-Z]{2})\)/).findAll().last()[1] + '-' + field2
//Result: 'JT-abcd'
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.