How to merge two catalog items flow into one in Flow desginer

test3445
Tera Contributor
 Hello I have a need which is to merge two catalog items into a single one and I have 2 scripts (workflows) that I want to merge into a single one as well. 
Problem is I a want to display the action (add,modify,delete) inside the descritipion of the change request  created but it doesnt display it in the description :
 
test3445_2-1730144900237.png

Change request description field:

test3445_1-1730144801303.png

My expected result :

test3445_3-1730144987536.png

 

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.

6 REPLIES 6

test3445
Tera Contributor

All good I misspelled a variable but now when using your script the change request is no longer created.

Can you share the flow execution screenshot


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