Need variables listed for approvals

Laura12
Tera Contributor

In my flow for the catalog item, it has to go through two approvals before creating the catalog task for fulfillment.  I've attached a screenshot of my flow and the approvals are using the OOB "approval request" notification (I've attached that screenshot too).  Now, the first approval group wants to see the variables selected by the requester and be able to modify the fields, if needed.  Is this possible?  Can I send a task to them with the variables and request approval?  Or should I modify the OOB notification?  Or add a subflow or action or??    

1 REPLY 1

Tudor
Tera Guru

Hi Laura,

My suggestion here would be to update the OOTB notification/create a new notification that would include the variables. - article which shows how you can get the variables in the email script:  https://community.servicenow.com/community?id=community_question&sys_id=c38b33841b482c503222ea89bd4bcb65

For the modification of fields, that could be potentially achieved via "Inbound actions", they would be required to follow a precise template as to how they update the variables, otherwise you script will not process their reply - docs here

Another option would be but have in mind that this is tricky:

  • to create a variable set, which contains variables(called generic parent), which is not displayed on the form.
  • add the variable set to all the catalog items
  • create a custom notification where you create a link to the catalog item in which you include the parent record(the record that requires approval)
  • create a catalog client script on the load that parses the link and checks whether there are any parameters called the parent
    • if yes, via an ajax, called all the variables and populate them in the form
    • create an onSubmit client script that will via an ajax overwrite all the modified values, where after this will block the submission of the catalog item and redirect the user to a particular page(never tried this part, but I don't see why it shouldn't work) - maybe someone has another idea.

Pros of the tricky solution:

  • full control over the user inputs
  • flexible - meaning it can be used for more than one catalog item

Cons of the tricky solution:

  • might break process flows:
    • ex: due to the selection of a variable a scheduled script actions has been inserted to be triggered at a particular moment in time. If that variable is changed, you will either have the write additional logic to delete the execution of the script or run the risk of having it execute even if it's no longer required.

Hope this helps,

 Tudor