- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-08-2022 08:23 AM
hi,
I need to check if a table’s field is empty to decide how many approvals the request should have.
the table :
the form :
On the form, user chooses a BLI.
A script retrieve Sector and other informations form the table.
what i need to do :
if the sector of the BLI don’t have an approval mentioned in the table, we return : NO
if the sector of the BLI choosen have a approver filled in , we return yes
u_bli_approval_group is a reference field (sys_user)
the script i m trying to do :
var appro = current.variables.filiere.u_bli_approval_group.getDisplayValue();
ifScript();
function ifScript() {
if (appro != null) {
return 'yes';
}
else {
return 'no';
}
}
thank you for your help
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-08-2022 08:38 AM
Hi,
so you need to query that table or if that variable refers that custom table you can directly dot walk
try this
ifScript();
function ifScript() {
var appro = current.variables.filiere.u_bli_approval_group;
if (appro != '') {
return 'yes';
}
else {
return 'no';
}
}
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-08-2022 08:38 AM
Hi,
so you need to query that table or if that variable refers that custom table you can directly dot walk
try this
ifScript();
function ifScript() {
var appro = current.variables.filiere.u_bli_approval_group;
if (appro != '') {
return 'yes';
}
else {
return 'no';
}
}
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-08-2022 10:53 AM
thank you Ankur.
It wotks 🙂