Flow Designer : Adding to, (Not replacing) comments in string variable after meeting IF condition. Possible?

Stephen31
Kilo Expert

Trying to use "flow designer", or I should say, required to use flow designer for something in particular. 

Hitting a roadblock (again) on something that is usually very simple to do in workflows.  Modifying a string variable (comment field) to include additional text depending on if it meets a condition.

There is a series of IF conditions and if meets one of them it needs to add a piece of information to the comments.  But so far it seems like I can only manage to get it to REPLACE what is there, not add to it.. so basically = not +=.  Anyone know how to get this designer to do this?  Can't find anything in the documentation.

Thank you!

1 ACCEPTED SOLUTION

Sukraj Raikhraj
Kilo Sage

Hey, look into adding a script action, which would allows an input, concatenate additional info to comments ...and capture the output  

View solution in original post

4 REPLIES 4

pratikjaiswal
Tera Guru

Hi Stephen,

 

Do you want to add an additional comment or edit an already present comment on the record?

 

 

Thanks,

Pratik

adding additional information to the text already present in the comment

Sukraj Raikhraj
Kilo Sage

Hey, look into adding a script action, which would allows an input, concatenate additional info to comments ...and capture the output  

Ian Mildon
Tera Guru

Not done anything like this in Flow but I have via Client Script or UI Policy; but you should be able to do something similar via a script action.

And to give you an idea on how to do this, here is a script I used to grab the current field values, push a new text value and on a new line add the original contents back.

var arrVal = [];
arrVal = g_form.getValue('u_inf_server_names');

var nMsg = "The 'Servers Used' field above is now obsolete and will be removed in 2022";

//only run if the message is not already set - prevent multiple message entries
if (arrVal.includes(nMsg)) {
    return;
} else {
    g_form.setValue('u_inf_server_names', nMsg + "\n\n" + arrVal); //push message AND original value(s) back into the field
}