Concatenation in breakdown script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2025 07:15 AM
my breakdown script is as below:
current.vulnerability.sys_id;
how do I concatenate a letter 'a' to this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2025 08:16 PM
Hi @venori26 ,
Please go through this below article
PA - Creating Breakdown script
It seems like you need to write something like
var concatenatedString()=function(){
var val="";
var gr=new GlideRecord('sn_vul_third_party_entry');
//below is important query that decides from 'sn_vul_third_party_entry' table which record has to be fetched.
gr.addQuery('vulnerability',current.sys_id); //here vulnerability is assumed as field from 'sn_vul_third_party_entry' table and fetching record from this table
gr.query();
//Based on multiple record or single record
if(gr.next()){
val=gr.id+" - "+gr.summary;
}
return val;
};
concatenatedString();
Thanks,
Bhimashankar H
-------------------------------------------------------------------------------------------------
If my response points you in the right directions, please consider marking it as 'Helpful' & 'Correct'. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2025 10:29 PM
Hello Sir,
Good morning/Evening,
Thank you so much for the response and script.
In this part of the script above -
gr.addQuery('vulnerability',current.sys_id); //here vulnerability is assumed as field from 'sn_vul_third_party_entry' table and fetching record from this table
vulnerability is a reference field in parent table sn_vul_vulnerable_item. using 'current' was giving me an error. so I modified the script a little by removing the current and modifying the line as below:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2025 09:15 AM
It won't work just using the sys_id @venori26 , you need to give the reference record as a filter.
did you go through the references I mentioned, you can make necessary changes by understanding what could work in your case from references.
As per the document it says the current refers to current record, it should not give any errors as such. Ensure you are using the correct relations between tables.
Please refer this post
How can I create a breakdown by task type on the Time Card table
and
Above post has your questions answer
Thanks,
Bhimashankar H
-------------------------------------------------------------------------------------------------
If my response points you in the right directions, please consider marking it as 'Helpful' & 'Correct'. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2025 12:55 AM
I used above code but it is gave me an error: Error during JavaScript evaluation: Not all references of "current" are passed in by "arguments" script: var id = current.getValue('vulnerability'); // sys_id as string
var val = id + "a"; // concatenate 'a'
val;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2025 03:11 AM
I tested the code from the link you shared for my scenario: it worked without concatenation but giving zero breakdown elements with concatenation:
working script:
