I need help with utilising ‘if’ statements to check if a field contains a value and then remove it and if a specific does not exist then add it.
For example:
• if ‘TESTING K SS’ does not contain ‘Roamer’ or ‘Wizard’ then on ‘USER ROLES’ remove ‘profile_418’ and ‘profile_419’, otherwise if ‘TESTING K SS’ does contain ‘Scout’ then then on ‘USER ROLES’ add ‘profile_417’
• else if ‘TESTING K SS’ does not contain ‘Scout’ or ‘Wizard’ then on ‘USER ROLES’ remove ‘profile_417’ and ‘profile_419’, otherwise if ‘TESTING K SS’ does contain ‘Roamer’ then then on ‘USER ROLES’ add ‘profile_418’
• else if ‘TESTING K SS’ does not contain ‘Scout’ or ‘Roamer’ then on ‘USER ROLES’ remove ‘profile_417’ and ‘profile_418’, otherwise if ‘TESTING K SS’ does contain ‘Wizard’ then then on ‘USER ROLES’ add ‘profile_419’
This must enact within one line within a field.
I have the below example that works in a different situation:
{{if(contains(81.field_235_raw; “profile_367”) | contains(81.field_235_raw; “profile_368”) | contains(81.field_235_raw; “profile_369”); remove(81.field_235_raw; “profile_367”; “profile_368”; “profile_369”); if(!contains(81.field_235_raw; “profile_366”); add(81.field_235_raw; “profile_361”; “profile_366”); 81.field_235_raw))}}