How to merge two catalog items flow into one in Flow desginer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2024 12:52 PM
Change request description field:
My expected result :
and here is the script I used in flow designer and I want to combine into one script that will display both add and delete action inside the description :
var aliasArr = fd_data._1__get_catalog_variables.liste_d_alias_dns_ajouter;
var description = "Comments: " + fd_data._1__get_catalog_variables.comments + "\n"+
"List of DNS aliases: " + "\n";
var j = 0 ;
for (var i = 0; i < aliasArr.length; i++) {
j = i + 1;
description += "Name["+j+"]: " + aliasArr[i].name + "\n" +
"Domain["+j+"]: " + aliasArr[i].domain + "\n" +
"Name or IP address["+j+"]: " + aliasArr[i].name_or_ip_address + "\n\n"
}
return description;
var aliasArr = fd_data._1__get_catalog_variables.list_of_dns_delete;
var description = "Comments: " + fd_data._1__get_catalog_variables.comments + "\n"+
"List of DNS aliases: " + "\n";
var j = 0 ;
for (var i = 0; i < aliasArr.length; i++) {
j = i + 1;
description += "Name["+j+"]: " + aliasArr[i].name_remove + "\n" +
"Domain["+j+"]: " + aliasArr[i].domain_remove + "\n" +
"Name or IP address["+j+"]: " + aliasArr[i].name_or_ip_address_remove + "\n\n"
}
return description;
Any help will be much appreciated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2024 01:26 AM
Hi @test3445
Try this
var aliasArr1 = fd_data._1__get_catalog_variables.liste_d_alias_dns_ajouter;
var description1 = '',
description2 = '';
if (aliasArr1 != '') {
description1 = "Comments: " + fd_data._1__get_catalog_variables.comments + "\n" +
"List of DNS aliases: " + "\n";
var j = 0;
for (var i = 0; i < aliasArr1.length; i++) {
j = i + 1;
description1 += "Name[" + j + "]: " + aliasArr1[i].name + "\n" +
"Domain[" + j + "]: " + aliasArr1[i].domain + "\n" +
"Name or IP address[" + j + "]: " + aliasArr1[i].name_or_ip_address + "\n\n"
}
}
aliasArr2 = fd_data._1__get_catalog_variables.list_of_dns_delete;
if (aliasArr2 != '') {
description2 = "Comments: " + fd_data._1__get_catalog_variables.comments + "\n" +
"List of DNS aliases: " + "\n";
var j = 0;
for (var i = 0; i < aliasArr2.length; i++) {
j = i + 1;
description2 += "Name[" + j + "]: " + aliasArr2[i].name_remove + "\n" +
"Domain[" + j + "]: " + aliasArr2[i].domain_remove + "\n" +
"Name or IP address[" + j + "]: " + aliasArr2[i].name_or_ip_address_remove + "\n\n"
}
}
return description1 + description2;
Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2024 09:38 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2024 10:36 PM
Can you please share screenshot of the code and error.
Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-04-2024 09:52 AM
All good I mispelled a variable but somehow the change request is no longer created.