How to Apply If Else Condition in Reference Qualifier
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2024 12:27 AM
Hello Everyone,
1) I have two variables on the form -
i) request type (request_type) - choice field - internal, external
ii) members (members) - list collector - sys_user table having test@gmail.com (internal user), test.ext@gmail.com (external user with "ext" mentioned in it)
I am having below requirement:
Now If I select 'request type' as 'internal' then only internal users should visible in the 'members' field and If I select 'request type' as 'external' then users having email ID containing 'ext' in it should be visible.
trying to achieve through reference qualifier of 'members' field.
Thanks,
Tejas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2024 12:50 AM
Hi @Community Alums ,
Please try the below:
javascript: var query; if (current.variables.request_type == "internal") query = 'emailNOT LIKEext'+(current.cat_item.sys_id||current.request_item.cat_item.sys_id); else query = 'emailLIKEext'+(current.cat_item.sys_id||current.request_item.cat_item.sys_id); query;
Mark this as Helpful / Accept the Solution if this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2024 01:14 AM
Hi @Community Alums
As a best practice, you should move your if-else logic to a Script Include and call it from the reference qualifier. You should not put if-else condition in a Reference Qualifier. You can refer below posts for reference :
Thanks and Regards
Amit Verma
Please mark this response as correct and helpful if it assisted you with your question.