How can I filter reference field based on another field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-13-2022 10:39 AM
Hi,
I have two reference fields on the catalog form, one is Requested for field (refers to sys_user table) and it auto-populates logged in user name.
Another field is Course completed field (refers to custom table). Now whenever requested for field auto-populates it should filter the records in course completed field based on requested for user email.
For example, in custom table I have 3 records with xxx@service-now.com it should show all three records based on requested for field.
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-13-2022 09:14 PM
Hi @reddy8055
In the course completed variable in reference qualifier section use below logic:
javascript: "emailFieldName="+current.variables.requested_forVariableName.email.toString(); //replace emailfieldname with email field name in your custom table and replace with requested for variable name in catalog
Screenshot for your reference:
Hope it helps:)
Murthy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-14-2022 04:38 PM
Hi Murthy,
Its working, but I want to add AND additional condition and its not working with that condition. There are different types of title and I want to show Only CyberMe 2022 along with requested for email
javascript:"u_email_id=" +current.variables.requested_for.email^u_title=CyberMe 2022 (O)
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-14-2022 07:32 PM
Hi @reddy8055
Small error only just update like the below at the end:
javascript: "u_email_id=" +current.variables.requested_for.email+'^u_title=CyberMe 2022 (O)';
//Make sure the title value will be correct
Hope it helps:)
Murthy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-15-2022 08:18 PM