Adding links to link field from a calculation
Hi,
I'm trying to create a calculation field that extracts urls from a 'text' field adds them to a 'link' field.
Currently i have this which adds the links to a comma separated string, and / or to an array, but neither the string nor the array add the links.
i.e
link_field = array
link_field = comma_string
This is the code i have so far
var message = @Text_Field;
var link_str;
var link_array = [];
var temp_str;
var i;
var set_stop = false;
var urlRegex = /(((https:?\/\/)|(http:?\/\/)|(www\.))[^\s]+)/g;
link_str = message.match(urlRegex);
i = 0;
do {
temp_str = String(String(link_str).split(",")[(i)]);
link_array[i] = temp_str;
i++;
}
while (i < 10);
@Link_Field = link_array;
I've also tried 'encodeURI, and also the Links field as a array -
i.e.
.. loop
@Links_Field[i] = link_array[i]
i++
...
Im pretty stuck on this so any help would be greatly appreciated.
Thanks,
Pete.
-
Hi Rainer,
Thanks for the response. I din't even think to check that first!
Similar to displaying Images in calculation fields, i.e. "", is there a similar way to embed videos / YouTube videos like how they appear in 'Link' fields? At the moment I can only display the clickable link.
Thanks
Please sign in to leave a comment.
Comments
2 comments