- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2024 02:03 AM
Hi guys, I am a newbie service now. I have a requirement and want to ask you for help
Requirement: I have 2 variables on a catalog item called variable A and variable B. Variable A is referenced from Table 1 ( Option a, b, c,...), and variable B is referenced from Table 2 ( option a1, a2, b1, b2, c1, c2,....).
Challenge: I want to create a client script to filter options for Variable 2 based on the option that is selected from Variable 1. For example, when users select option a from Variable A, the variable B will filter options a1, a2, a3, ..
Solution: How can I use Glide Ajax and Script Include for this requirement? Can you give me a suggestion? Thank you
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2024 02:15 AM
hi @LinhN ,
You can use reference quantified in the Secord variable.
javascript:'field_used_for_filtering=' + current.variables.VARIABLE A
Please accept my solution if it works for you and thumps up to mark it as helpful.
Thank you!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2024 03:14 AM
Hi @LinhN,
This can be easily achieved with the use of an Advanced Reference Qualifier - not client script is required.
The trick is to make sure you have the syntax correct. Check my screen shot and this code:
javascript:'group=' + current.variables.ref_1
// for your script you'll need something like:
javascript:'your_variable_a_field_name=' + current.variables.variable_b //where you have variable b, this should be the matching value against your variable a field
In the below example, I've got 2 ref fields (Called Ref 1: 'ref_1' and Ref 2: 'ref_2)
Ref 1 is pointing to the 'Group' table (sys_user_group) and Ref 2 is pointing to the Group Member table (sys_user_grmember).
The Group Member are filtered by the Group field.
To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Kudos.
Thanks, Robbie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2024 02:15 AM
hi @LinhN ,
You can use reference quantified in the Secord variable.
javascript:'field_used_for_filtering=' + current.variables.VARIABLE A
Please accept my solution if it works for you and thumps up to mark it as helpful.
Thank you!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2024 02:26 AM
Oh. The table of variable A ( table 1) is different from variable B ( table 2). The table for the variable B has a field reference to table 1. I have used your suggestion but it didn't work. Can you suggest to using Client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2024 03:14 AM
Hi @LinhN,
This can be easily achieved with the use of an Advanced Reference Qualifier - not client script is required.
The trick is to make sure you have the syntax correct. Check my screen shot and this code:
javascript:'group=' + current.variables.ref_1
// for your script you'll need something like:
javascript:'your_variable_a_field_name=' + current.variables.variable_b //where you have variable b, this should be the matching value against your variable a field
In the below example, I've got 2 ref fields (Called Ref 1: 'ref_1' and Ref 2: 'ref_2)
Ref 1 is pointing to the 'Group' table (sys_user_group) and Ref 2 is pointing to the Group Member table (sys_user_grmember).
The Group Member are filtered by the Group field.
To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Kudos.
Thanks, Robbie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2024 07:06 PM
It looks good. I have used your suggestion and it worked. Thank you very much