
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2024 03:32 AM
Probably really simple one this where im having a moment!
I have a topic decision that I am trying to build that looks at a reference field on the users company record and depending on the answer, will take the user on the specific journey.
Each branch script condition script has the following with the relevant sys_id:
(function execute() {
if (vaInputs.user.company.u_support_tier == '583d8e3e1bcfe5901b8eec69b04bcbca')
return true;
})()
But this doesnt seem to work! Please could someone point me in the right direction for this?
Many thanks
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2024 05:40 AM
I achieved this in the end by doing an initial script utility before the decision:
(function execute() {
var gr = new GlideRecord('sys_user');
gr.addQuery('sys_id', vaInputs.user.sys_id);
gr.query();
if (gr.next()) {
var supportTier = gr.company.u_support_tier.getDisplayValue();
//gs.info('M_iA Support Tier: ' + supportTier);
vaVars.supportTier = supportTier;
} else {
//gs.info('M_iA No user found with sys_id: ' + vaInputs.user.sys_id);
}
})();
and then for each descision, I had the following:
(function execute() {
//gs.info('M_iA Support Tier: ' + vaVars.supportTier);
if (vaVars.supportTier == 'Essential UK' || vaVars.supportTier == 'Essential ROI') {
return true;
} else {
return false;
}
})();

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2024 05:40 AM
I achieved this in the end by doing an initial script utility before the decision:
(function execute() {
var gr = new GlideRecord('sys_user');
gr.addQuery('sys_id', vaInputs.user.sys_id);
gr.query();
if (gr.next()) {
var supportTier = gr.company.u_support_tier.getDisplayValue();
//gs.info('M_iA Support Tier: ' + supportTier);
vaVars.supportTier = supportTier;
} else {
//gs.info('M_iA No user found with sys_id: ' + vaInputs.user.sys_id);
}
})();
and then for each descision, I had the following:
(function execute() {
//gs.info('M_iA Support Tier: ' + vaVars.supportTier);
if (vaVars.supportTier == 'Essential UK' || vaVars.supportTier == 'Essential ROI') {
return true;
} else {
return false;
}
})();