Retrieve URL from user Session for creating user criteria
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2024 03:04 AM
Hi, I have a requirement to set up a user criteria that will work according to the user's URL, when there is a suffix that is in the URL then the criteria user will be activated, are there options to implement such a requirement through a user criteria?
Thanks
2 REPLIES 2

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2024 04:55 AM
Hi @SKCH ,
I presume you can try it like this...
/** Scripted User Criteria is not cached, and evaluated everytime, so performance is dependent on the script.
* Populate `answer` with true/false or evaluate to true/false
* The script is evaluated in the scope the user criteria is defined
* Don't use `current` in the script or populate the variable
* Don't use `gs.getUser()` or `gs.getUserID()`,
* instead use `user_id` which contains the user sys_id against whom the evaluation is happening.
*/
/* Call the function */
answer = checkCondition();
/* Declare the function that checks the divisional belonging */
function checkCondition(divisionId, userId) {
var debug = true;
var currentUrl = gs.getProperty("glide.servlet.uri") + gs.action.getGlideURI();
var suffix = 'user_criteria_diagnostics';
if (debug) { gs.info('DEBUG >>> User URL: {0}', currentUrl); }
return currentUrl.indexOf(suffix) != -1;
}
Regards, Ivan
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2024 02:15 AM
Hi Ivan,
Thanks for you answer, but it didnt work.