Compare a String with a Choice field.

ashish9
Tera Contributor

On the Use table Country is a choice field is having country value example United States, I want to push UNITED STATES from integration then I want both the country to match and the user table country field should be set as United States which is a choice field.. This has to be done with Business Rule. 

1 ACCEPTED SOLUTION

Tony Chatfield1
Kilo Patron

Hi, in my opinion best practice for updating\altering integration data would be to utilize a scripted rest API and/or to insert into a temp data table and use a transform map to populate correct data into your target record(s).

I do not see an OOB 'Country' field on sys_user table, but based on your post you could try something like this as a before insert BR

 

if(current.yourFieldName == 'UNITED STATES') {

current.yourFieldName = theCorrectChoiceListRecordValue;

};

 

Edit, apologies the 'county' field has a label of 'Country code' and I Assume that this is the field involved, so based on OOB your script might be like this

if(current.country == 'UNITED STATES') {

current.country = 'US';

};

View solution in original post

1 REPLY 1

Tony Chatfield1
Kilo Patron

Hi, in my opinion best practice for updating\altering integration data would be to utilize a scripted rest API and/or to insert into a temp data table and use a transform map to populate correct data into your target record(s).

I do not see an OOB 'Country' field on sys_user table, but based on your post you could try something like this as a before insert BR

 

if(current.yourFieldName == 'UNITED STATES') {

current.yourFieldName = theCorrectChoiceListRecordValue;

};

 

Edit, apologies the 'county' field has a label of 'Country code' and I Assume that this is the field involved, so based on OOB your script might be like this

if(current.country == 'UNITED STATES') {

current.country = 'US';

};