Transform Script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2023 09:52 AM
Requirement:
spreadsheet column A has set of Values like sample " ccPlus", "ccSCO" etc.
Need to update the target Table (choice list) with values like " If column A contains Plus" --> The target table should be populated with Value 1. if If column A contains SCO " --> The target table should be populated with Value 2 etc
Any leads ?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2023 11:27 AM
@Priya123 You should have your tranformEntry script as follows.
answer = (function transformEntry(source) {
if (source.column_A.includes('Plus')) {
return 'Value 1';
} else if (source.column_A.includes('SCO')) {
return 'Value 2';
}
})(source);
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2023 01:05 PM
Thank you Sandeep but doesnt the includes stmt return only true or False.. cos am using includes as well but since its a lot to check, i have to give a really long check condn to set the value cos it returns either true or False... tried the above one, but am unable to use the return Value in further if stmts..