Is there any way to insert two urls in URL type field and each should be clickable.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-22-2020 11:12 PM
We have URL type field and we want to store multiple urls in it. How we can do this or is there any alternative for this to do.
Note - each link should be clickable.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-23-2020 12:01 AM
Hi,
Create multi-line string field where users would enter URLs on new line
then use before insert/update BR on table
Condition: multi-line string field is not empty
1) get the URLs from the multi-line text field and then split and store in journal fields
var urls = current.u_multi_line.split('\n'); // give here your multiline text field
var url = '';
for(var i=0;i<urls.length;i++){
url = url + '[code]<a href="' + urls[i] + '">' + 'Link' + '</a>[/code]';
}
current.journal_field = url; // give valid field name here
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
‎10-23-2020 12:25 AM
Hi Ankur,
I created string field also created journal field and created BR as per your suggestion still not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-23-2020 01:32 AM
Hi Ankur,
Any update on this from your side.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-23-2020 01:39 AM
Hi,
so you have created string field.
how are different URLs stored? with comma separated
please share screenshot and your script
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
‎10-23-2020 02:01 AM
the field type should be journal_input.
Also updated BR script
(function executeRule(current, previous /*null when async*/) {
var urls = current.u_enter_urls.split('\n'); // give here your multiline text field
var url = '';
for(var i=0;i<urls.length;i++){
url = url + '[code]<a href="' + urls[i] + '">' + urls[i] + '</a>[/code]' + '\n';
}
current.u_multi_urls = url;
})(current, previous);
Output: check INC0010004
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader