Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, guys!
Hello everyone, I can't use GetFieldSelections in an IF in script? I did this in the code however, it is not working.
=IF(Replace(GetFieldSelections(WORKSHIFT),'Night 1', 'This is Work shift 1',
IF(Replace(GetFieldSelections(WORKSHIFT),'Morning', 'This is Work shift 2'))))
if what you want to do is replace the shift code with some description and you only have 2 values you can use it in cascade:
Replace(
Replace(
GetFieldSelections(WORKSHIFT),
'Morning',
'This is Work shift 2'
),
'Night 1',
'This is Work shift 1'
)
the result of the inner replace becomes the input to the outer one.
however, i would suggest a different way. i would create an association between WORKSHIFT and a WORKSHIFT_DESC field. where WORKSHIFT_DESC is obviously the description. when workshift is selected, the descriptions are
=concat(distinct WORKSHIFT_DESC,',') which will be the same result. however, the advantage of this is you can have as many values for WORKSHIFT and you dont need to change your code. that is, if tomorrow, a new value is added you will need 3 levels of replace.
this may not apply to you but at least you know there is an alternative for the future.
if what you want to do is replace the shift code with some description and you only have 2 values you can use it in cascade:
Replace(
Replace(
GetFieldSelections(WORKSHIFT),
'Morning',
'This is Work shift 2'
),
'Night 1',
'This is Work shift 1'
)
the result of the inner replace becomes the input to the outer one.
however, i would suggest a different way. i would create an association between WORKSHIFT and a WORKSHIFT_DESC field. where WORKSHIFT_DESC is obviously the description. when workshift is selected, the descriptions are
=concat(distinct WORKSHIFT_DESC,',') which will be the same result. however, the advantage of this is you can have as many values for WORKSHIFT and you dont need to change your code. that is, if tomorrow, a new value is added you will need 3 levels of replace.
this may not apply to you but at least you know there is an alternative for the future.
Thank you, Edwin!!!
yw