- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2025 04:26 AM - edited 05-02-2025 05:03 AM
I need to send the RITM number appended link to it as a parameter but before it I am just checking whether its coming as a output or not? I got no luck. What went wrong in ritm_url variable value??
(function execute(inputs, outputs) {
var ritm_url = '<a href=" ' + gs.getProperty('glide.servlet.uri') +inputs['ritmTableName']+'.do?sys_id=' + inputs['ritmSysId'] +'">' + inputs['requestNumber'] + '</a>';
outputs.url = ritm_url;
})(inputs, outputs);
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2025 08:58 AM
try this, I could see you are getting the sysId and request number correct
you cannot get the value using this syntax inputs['ritmTableName']
there was an extra space before href
(function execute(inputs, outputs) {
var ritm_url = '<a href="https//' + gs.getProperty("glide.servlet.uri") + '/' + inputs.ritmTableName + '.do?sys_id=' + inputs.ritmSysId + '">' + inputs.requestNumber + '</a>';
outputs.url = ritm_url;
})(inputs, outputs);
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2025 10:35 AM
Your anchor tag has two issues:
Extra space in the href
You wrote '<a href=" ' + … which outputs <a href=" https://…">. That leading space breaks the URL.Wrong input key
If inputs['ritmTableName'] isn’t defined, you end up with undefined.do?sys_id=…. Make sure the input name in your Flow Action exactly matches (e.g. inputs.ritmTableName vs inputs.ritm_table_name).
Fixed version (no stray space, correct inputs):
(function execute(inputs, outputs) { // ensure glide.servlet.uri ends with '/' var base = gs.getProperty('glide.servlet.uri'); var table = inputs.ritmTableName; // must match your defined input name var id = inputs.ritmSysId; var num = inputs.requestNumber; var ritm_url = '<a href="' + base + table + '.do?sys_id=' + id + '">' + num + '</a>'; outputs.url = ritm_url; })(inputs, outputs);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2025 04:54 AM
I believe if you are getting the correct output then it should be fine.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2025 05:22 AM
Would you mind closing your earlier questions by marking appropriate response as correct?
Members have invested their time and efforts in helping you.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2025 10:35 AM
Your anchor tag has two issues:
Extra space in the href
You wrote '<a href=" ' + … which outputs <a href=" https://…">. That leading space breaks the URL.Wrong input key
If inputs['ritmTableName'] isn’t defined, you end up with undefined.do?sys_id=…. Make sure the input name in your Flow Action exactly matches (e.g. inputs.ritmTableName vs inputs.ritm_table_name).
Fixed version (no stray space, correct inputs):
(function execute(inputs, outputs) { // ensure glide.servlet.uri ends with '/' var base = gs.getProperty('glide.servlet.uri'); var table = inputs.ritmTableName; // must match your defined input name var id = inputs.ritmSysId; var num = inputs.requestNumber; var ritm_url = '<a href="' + base + table + '.do?sys_id=' + id + '">' + num + '</a>'; outputs.url = ritm_url; })(inputs, outputs);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2025 10:31 PM
were