Get a first look at what's coming. The Developer Passport Australia Release Preview kicks off March 12. Dive in! 

Draft and Populate Catalog Item Variables From Flow or Business Rule

neil_b
Tera Guru

Hi,

 

I have a requirement where if a user gets deactivated from our organization, we need a request submitted to revoke their software license. How can this be achieved?

 

Currently, it's somewhat of a manual process, although it is mostly automated other than two button clicks for the user. We currently have a flow that is triggered when a user's record changes from Active = True to Active = False and when that happens, it checks if any requests exist that have a software license effective date that is still effective as of today's date or in the future. When it finds the request, it sends an email to the Assigned To user that the Requested For user has been deactivated and to click a button on the notification to revoke their software license. The user clicks a button on the email, and it automatically opens the catalog item in our Service Portal and automatically populates the variables in the form, so all the user has to do is click Submit.

 

Here is a snapshot of the flow:

Revoke Flow.png

 

Here is the mail script on the notification that populates the variables for the user when they click the botton:

        var sysid = current.sys_id;
	var nameOfPerson = current.variables.name_of_person.getValue();

        url = gs.getProperty('glide.servlet.uri') + 'sp?id=sc_cat_item&sys_id=12345678910&sysparm_category=12345678910&request=revoke&name_of_person=' + nameOfPerson + '&revoked=' + sysid;
    
    template.print(global.OutlookRoundedButtonDynamic('Revoke License', '16', 'FFFFFF', 'ce1141', '7', '20%', url) + ' ');


When the Assigned To user clicks the Revoke License button on the email, the catalog item opens in the browser and auto-populates the variables from the URL and the Assigned To user just has to click Submit.

 

We would like to automate this further to where, instead of sending an email notification and have the Assigned To user click a button to submit the request for revoking the software license, we just want a request automatically submitted without any inputs from users.

 

Is this possible via flow?

8 REPLIES 8

Hi,

Thanks for sharing the screenshot — that helps

The reason you’re not seeing Requested For / Opened By fields is because you’re using the Record Producer action in Flow Designer. This action only exposes variables, not the actual record fields.

Also, Record Producer scripts (like the one setting requested_for) do not reliably execute in Flow, since they are primarily designed for UI/Portal submissions.

 Solution

Instead of using the Record Producer action, switch to:

Create Catalog Request Item

This will allow you to explicitly set system fields.

Steps:

  1. Remove the Record Producer action

  2. Add Create Catalog Request Item action

  3. Configure:

    • Catalog Item → Software License

    • Requested For → Trigger → User

    • Opened By → Trigger → User or System

  4. Map all required variables (Name, Comments, Revoked, etc.)

ayushraj7012933
Kilo Guru

Hi,

This is expected behavior. When a request is created via Flow Designer, the Record Producer script does not execute, which is why fields like Requested For and Opened By remain blank.

Solution

You need to explicitly set these fields within the Flow.

Since your flow is triggered on user deactivation:

  • In Create Catalog Request Item action:

    • Requested For → Trigger → User

    • Opened By → System user or Trigger → User

This is the simplest and most reliable approach.

@ayushraj7012933 it doesn't appear I have those fields available to select from. Please see my screenshot below of the Flow Action. It only has the variables to input. 

Flow Action.png

ayushraj7012933
Kilo Guru

Hi  @neil_b ,

Thanks for sharing the screenshot — that helps 

The reason you’re not seeing Requested For / Opened By fields is because you’re using the Record Producer action in Flow Designer. This action only exposes variables, not the actual record fields.

Also, Record Producer scripts (like the one setting requested for) do not reliably execute in Flow, since they are primarily designed for UI/Portal submissions.

 Solution

Instead of using the Record Producer action, switch to:

Create Catalog Request Item

This will allow you to explicitly set system fields.

Steps:

  1. Remove the Record Producer action

  2. Add Create Catalog Request Item action

  3. Configure:

    • Catalog Item → Software License

    • Requested For → Trigger → User

    • Opened By → Trigger → User or System

  4. Map all required variables (Name, Comments, Revoked, etc.)