Is there any way to insert two urls in URL type field and each should be clickable.

Peter Wood
Kilo Guru

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.

20 REPLIES 20

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

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Hi Ankur,

I created string field also created journal field and created BR as per your suggestion still not working

Hi Ankur,

Any update on this from your side.

Hi,

so you have created string field.

how are different URLs stored? with comma separated

please share screenshot and your script

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

@Peter Wood 

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

find_real_file.png

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader