Want to hide few catalog item on the bases of language selected
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2024 03:10 AM
Hello everyone,
I want hide some catalog items on the bases of user preferred language. For example If few user select Dutch language or Nederland in language dropdown under profile then few catalog item should not visible to them
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2024 03:20 AM
Catalog items are usually restricted based on Available For and Not Available For related lists, both contains records from User Criteria table.
In the User Criteria, create a new record say NonDutchUsers & can add this Adv Script:
answer = gs.getUser().getPreference('glide.ui.locale') !== 'nl';
Use List view of m2m tables to add a User Criteria for multiple items in one go.
Tip: You can also add User Criterias under Catalogs incase all items under Catalog belong to one restriction as per your requirement
If my response proves useful, please mark it "Accept as Solution" and "Helpful". This action benefits both the community and me.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2024 03:30 AM
I tried the above script and added the user criteria in catalog item under available for but the catalog item is still visible
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2024 07:58 AM
The language preferences are stored in the User Preference [sys_user_preference] table under the "user.language" name.
All records from this table can retreived and validated as suggested abobe but with the correct name of the preference:
answer = gs.getUser().getPreference('user.language') != 'nl';