The Zurich release has arrived! Interested in new features and functionalities? Click here for more

How can I set a value in my RITM based on a variable, in a workflow?

twoodruff
Kilo Explorer

I'm kinda new to workflows, but I've run into a brick wall and can't figure out how to do this.

All I want to do is make it so when an RITM is generated, a variable ("additional_notes") that is part of a variable set ("additional_comments") is saved to the "description" field.

So for example, a user would fill out a request intake form from the service catalog. A RITM would be generated under the REQ.

Any text entered into the "additional_notes" variable field on the intake form, I want that saved into the RITM's "description" field when it is generated.

I know this is probably something really simple that I'm missing, but hopefully you lovely folks will take pity on me and help me out. ^_^

Thanks!

1 ACCEPTED SOLUTION

Hi, try using a script activity and set the value accordingly on the following way:



current.description = current.variables.additional_notes;



Thanks,


Berny


View solution in original post

8 REPLIES 8

twoodruff
Kilo Explorer

I can't seem to edit my post, so I'll put this in a reply: I'm wondering it I can just go into the workflow for the RITM and use 'set values' to set "description" to "${current.variables.additional_comments.additional_notes}", but that doesn't seem to be working. 😕


The description field remains blank.



Going into 'properties', and then to the 'inputs' tab, I don't see anything listed there.


Maybe I'm missing something rather fundamental about getting the variables into this particular workflow? :-S


gxtZ5uN.png


Hi, try using a script activity and set the value accordingly on the following way:



current.description = current.variables.additional_notes;



Thanks,


Berny


I believe you may also have to add a current.update(); after the assignment takes place.



Thanks,


Berny


Thanks Berny! This script in a business rule did it for me:



function onAfter(current, previous) {


    //This function will be automatically called when this rule is processed.


  current.description = current.variables.additional_notes;


  current.update();


}



I triggered it to run only on after INSERT, so it won't overwrite anything.



Your answer is greatly appreciated. Do you know whether this is possible to do from within the workflow, or must it be done via a business rule or something?