Draft and Populate Catalog Item Variables From Flow or Business Rule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
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:
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Apologies @ayushraj7012933 I don't believe I have that spoke installed in our Workflow Studio. See image:
I did, however, find this action:
Unfortunately, this action also does not have a field for me to configure the Requested For and Opened By.
Submit Catalog Item and Record Producers are the only two actions we have available as we are only using a limited application scope.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @neil_b ,
You’re running into a known limitation here
Since you’re using Submit Catalog Item / Record Producer in Flow Designer (and in a limited scope), the Requested For and Opened By fields are not exposed, and Record Producer scripts won’t execute as they do in the portal.
Working Approach
You can handle this by updating the RITM after it gets created.
Step-by-Step
Submit the Catalog Item
Use Submit Catalog Item action (as you’re already doing)
Map all required variables
Capture the output:
Requested Item (RITM sys_id)
Add “Update Record” Action
Table:
sc_req_itemRecord: Use the Requested Item data pill from previous step
set the Fields
Map the values as:
Requested For → Trigger → User (the deactivated user)
Opened By →
Trigger → User
OR System (based on your requirement)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
Hi @ayushraj7012933 that worked! I was able to populate the Requested For and Opened By fields using the method you suggested. I have one last challenge I was hoping you could help me with. The "Submit Catalog Item" Action has a system limitation and can only map 40 variables, however our catalog item has well over 40+ variables. I did notice that at the bottom of the action, the last field has "Variables as JSON".
I'm wondering, could I use this field to map all the variables using script? If so, could you confirm for me that I've written this code correctly? This is just a small snippet for proof of concept. I would update this as needed for the remaining 40+ variables.
// Define all variables in a JSON object from the previous software license request
var requestType = fd_data._7__get_catalog_variables.request_type;
var nameOfPerson = fd_data._7__get_catalog_variables.name_of_person;
var revocationDate = fd_data._7__get_catalog_variables.date_required
var details = {
// Key-value pairs for all variable names and their desired values
'variables': {
'request_type': requestType,
'name_of_person': nameOfPerson,
'date_required': revocationDate
}
};
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
Hi @neil_b ,
You’re definitely heading in the right direction by using “Variables as JSON” to handle the 40-variable limitation in the Submit Catalog Item action
This is a commonly used approach when a catalog item has a large number of variables. Just a small tweak is needed in your script to make it work as expected.
script
// Define all variables
var requestType = fd_data._7__get_catalog_variables.request_type;
var nameOfPerson = fd_data._7__get_catalog_variables.name_of_person;
var revocationDate = fd_data._7__get_catalog_variables.date_required;
// Create flat JSON object
var details = {
'request_type': requestType,
'name_of_person': nameOfPerson,
'date_required': revocationDate
};
// Return JSON string
return JSON.stringify(details);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
Hi @ayushraj7012933 I modified my script exactly as you've suggested but I'm still not seeing the variables populated with the values. The variables are still blank.
However, I tried to troubleshoot by running gs.info code and I confirmed that the logs are returning the correct data.
The logs are returning:
stringify {"request_type":"Revocation","name_of_person":"John Doe","date_required":""03-25-2026",}
If the logs are capturing the correct data, why isn't the data getting stored in the variable?
