Approval need to be triggered to the particular person based on option selected in variable

suuriyas
Tera Contributor

HI Community,

 

I have a requirement, created a table called 3d in the table we have name and approver fields

And this table is used in the variable of the catalog (reference) now when the option is selected in the variable then approval needs to be triggered to that particular person how we can achieve this in flow designer

 

Please explain in detail

 

Thanks in Advance

1 ACCEPTED SOLUTION

 

Hi @suuriyas,

 

Actually you won't need flow variables, I was trying to do the same on my PDI and I did not need a flow variable.

 

1- Get Catalog Variables

MediC_5-1741355940482.png

 

2 - Look up User Record

MediC_4-1741355863433.png

 

3 - Ask for Approval

MediC_3-1741355719831.png

 

I hope it helps!

 


If you found this helpful, please hit the thumbs-up button and mark as correct. That helps others find their solutions.

View solution in original post

5 REPLIES 5

Medi C
Giga Sage

You would need

  1. Flow Action "Get Catalog Variable"
  2. Look up Record: To get the user based on information from the variable.
  3. Store the user in Flow Variable (Type Reference --> User)
  4. When requesting approval, you can simply then select the user from the Flow variable

 


If you found this helpful, please hit the thumbs-up button and mark as correct. That helps others find their solutions.

Debasis Pati
Tera Guru

Hello @suuriyas ,

Add an Action to Retrieve the Approver:

  • Add the Lookup Record action.

  • Configure it to look up the 3d table where the name field matches the selected variable value.

  • Store the approver field in a flow variable.
    var approver = new GlideRecord('u_3d');
    approver.addQuery('name', current.variables.specify_staff);
    approver.query();
    if (approver.next()) {
    var approverId = approver.getValue('approver');
    }

    Add an Approval Action:

    • Add the Ask for Approval action.

    • Set the approver to the value stored in the flow variable.

      var approval = new GlideRecord('sysapproval_approver');
      approval.initialize();
      approval.setValue('approver', approverId);
      approval.setValue('source_table', 'sc_req_item');
      approval.setValue('source_id', current.sys_id);
      approval.insert();


      Please follow the above steps to achieve your requirement.

      Kindly mark it as correct and close the thread.

      Regards,
      Debasis




Medi C
Giga Sage

 

Hi @suuriyas, here are the steps that you can follow:

 

  • Trigger the Flow

    • Set up the Flow to trigger when a Catalog Item Request is submitted.
    • Use the Trigger Type as "Requested Item Record Inserted" or "Requested Item Updated", depending on when you want the Flow to start.
  • Retrieve the Selected Variable Value

    • Use the "Get Catalog Variable" Flow Action to extract the value of the reference variable (which stores the selection from the "3d" table).
  • Lookup the Approver from the Table

    • Use the "Look Up Records" Action to find the appropriate approver from the "3d" table based on the selected name.
    • Query the 3d Table where the Name field matches the selected value from the catalog variable.
  • Store the Approver in a Flow Variable

    • Store the retrieved approver in a Flow Variable with a Reference Type → User.
    • This ensures the Flow can use the approver dynamically in the approval action.
  • Trigger an Approval Action

    • Use the "Ask for approval" Action.
    • In the Approver Field, select the Flow Variable (which holds the approver retrieved from the "3d" table).
  • Define Approval Outcome

    • Set conditions for approval and rejection.
    • Based on approval, proceed with the next steps (e.g., fulfillment, notifications).
    • If rejected, define an alternate path (e.g., notification to the requester).

 

 


If you found this helpful, please hit the thumbs-up button and mark as correct. That helps others find their solutions.

suuriyas
Tera Contributor

HI @Medi C 

 

Can you please elaborate more on point 3 and 4 if possible with the example