How to retrieve words from a string field?

SN_Learn
Kilo Patron
Kilo Patron

Hi All,

 

I have some strings stored in a field on an Incident form.

 

example:

field_name = description

It contains the highlighted string: No-conflict,P3-Priority,Chief Testing,xt_mapping:FURIOUS,XTREM, gt_kick:rtr,xt_mention:CC-Dnr-pola,[Google]type_believe:customer,xt_mention:hpi-t9d-brmr,[google]xt_mapping:GROUP


My requirement is to get the data which is stored in xt_mapping and xt_mention fieldsIt means I wish to get all the data which is stored in both those field in the whole string.

The output should contain FURIOUS and  GROUP
For, xt_mention the output should be CC-Dnr-pola and pi-t9d-brmr

 

Any help would be appreciated, thanks.

----------------------------------------------------------------
Mark this as Helpful / Accept the Solution if this helps.
1 ACCEPTED SOLUTION

The below code worked fine, thank you for the assistance.
 
 
var a = 'No-conflict,P3-Priority,Chief Testing,xt_mapping:FURIOUS,XTREM, gt_kick:rtr,xt_mention:CC-Dnr-pola,[Google]type_believe:customer,xt_mention:hpi-t9d-brmr,[google]xt_mapping:GROUP, xt_goodies: Testing';
var b = a.split(',');
var tag = 'xxt_mention:';

for(i = 0; i< b.length; i++){
if(b[i].indexOf('xt_mention') != -1){
var c = b[i].split(':');
tag += c[1] + ',';
}
}
gs.print(tag);
----------------------------------------------------------------
Mark this as Helpful / Accept the Solution if this helps.

View solution in original post

5 REPLIES 5

The below code worked fine, thank you for the assistance.
 
 
var a = 'No-conflict,P3-Priority,Chief Testing,xt_mapping:FURIOUS,XTREM, gt_kick:rtr,xt_mention:CC-Dnr-pola,[Google]type_believe:customer,xt_mention:hpi-t9d-brmr,[google]xt_mapping:GROUP, xt_goodies: Testing';
var b = a.split(',');
var tag = 'xxt_mention:';

for(i = 0; i< b.length; i++){
if(b[i].indexOf('xt_mention') != -1){
var c = b[i].split(':');
tag += c[1] + ',';
}
}
gs.print(tag);
----------------------------------------------------------------
Mark this as Helpful / Accept the Solution if this helps.