- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-11-2023 05:33 AM - edited ‎10-11-2023 05:37 AM
So, firstly we create a custom table have 4 field :-
1. Article No- Type String.
2. Short Description - Type String.
3. Space Key - Type String.
4. Kbbody - Type Html.
Actually we have an excel file, in which we have a field name Kbbody in the following field we have an https link.
Task- Actually we have to create the script include and call the script into transform map. While working on the task we can not able to generate any link in the Kbbody field.
After some hardwork we are able to see some number in the field. By the field map script following script was:-
var sc = new global.scriptinclude_name();
var op = sc.function_name(source.u_kbbody);
source.u_kbbody = op;
gs.info('Transformed KBBody: ' + op);
return op;
By that we need a small requirement.
The following pattern are in regex:-
function_name: function(inputText) {
var regexPattern1 = /<a href="https:\/\/123@mail.com\/wiki\/spaces\/LinkTest\/pages\/(\d+)">([^<]+)<\/a> inline/g;
//The specific pattern we are doing to replace with :-
var outputText = inputText
.replace(regexPattern1, '<p>Linking Page 1 here <a href="123@gmail.com">Page Link</a>')
return outputText;
We need to convert the href link into amslink:12347556(our links coverted into random number
Can anyone suggest me how to achieve this requirement.
Every instruction will be helpful.
Thanks and Regards,
Sanjeet Kumar.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-11-2023 08:11 AM
Make sure you don't use capitol letters so just amslink instead of Amslink
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-11-2023 07:53 AM - edited ‎10-11-2023 07:55 AM
Hi @sanjeet1245,
I was under the impression that you wanted to use amslink as a hyperlink. Similiar to mailto:email@address?
But in your code in looks like you are trying something else.
Can you explain what the amslink is supposed to do?
Also, in your regexes, you need to escape all the dots ( . )
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-11-2023 08:01 AM - edited ‎10-11-2023 09:56 PM
okay i correct my mistake and i want my output like amslink: 615112(any random number it create).

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-11-2023 08:03 AM
Hi @sanjeet1245,
You still have the . in the regexpatters not escaped.
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-11-2023 07:50 AM
the changes i done in html sanitizer as per your suggestion

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-11-2023 08:11 AM
Make sure you don't use capitol letters so just amslink instead of Amslink
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.