Create a subflow to reclaim a user
- UpdatedAug 3, 2023
- 3 minutes to read
- Vancouver
- IT Asset Management
The Vancouver release is no longer supported. As such, the product documentation and release notes are provided for informational purposes only, and will not be updated.
Create a subflow to reclaim a user subscription.
Before you begin
This subflow requires an action to remove a user. For more information, see Create an action to remove a user.
Role required: flow_designer or admin
About this task
Note: For examples of subflows to reclaim a user, see the Jira Reclaim
Subscription and Webex Reclaim Subscription subflows.
Procedure
- Navigate to All > Flow Designer > Designer.
- Click New and then select Subflow.
-
On the form, fill in the fields.
Table 1. Subflow Properties form Field Value Name Name of your choice. For example, Application Reclaim Subscription, where Application is the name of the SaaS application you are integrating with. Application Software Asset Management - SaaS License Management Integrations. Note: If you save the subflow in the Software Asset Management - SaaS License Management Integrations application, it's included with your Software Asset Management subscription. If you save the subflow in any other application, you may be charged for ServiceNow® Integration Hub transactions. If you're publishing your custom spoke application on the ServiceNow Store, select your custom app instead.Accessible From All application scopes. Category Leave this field empty. Protection None. In-Flow Annotation Leave this field empty. Description Description of your choice. Run As User who initiates session. -
Add an integration profile input and a user subscription input.
Table 2. Inputs Label Name Type Mandatory Integration profile integration_profile Reference.Integration Profile Yes User subscription user_subscription Reference.Software Subscription Yes -
Add an error message output and a status output.
Table 3. Outputs Label Name Type Error message error_message String Status status String - In the Actions section, click the plus icon and then click Action to add a new action.
-
In the list of installed spokes, select the spoke for the SaaS application that
you're integrating with.
Note: To add additional spokes to your list of installed spokes, request them on the ServiceNow Store. For a complete list of available spokes, see IntegrationHub available spokes. If there's no existing spoke for the SaaS application that you want to integrate with, you can create a new spoke.
-
To remove a user, select an action.
-
Define the value to pass as the User ID input.
The value that you use depends on the API that you're working with, but it will generally be the External user ID or User principal name field from the User subscription input for this subflow.
- Define the values to pass for any user authentication inputs for the action.
-
Define the value to pass as the User ID input.
- To check if the Remove User action returns an error, add an If flow logic.
-
Add a child flow logic to assign subflow outputs.
Table 4. Assign Subflow Outputs Name Data Error message Error message output from the Remove User action Status failure - Add an Else flow logic at the same level as the If logic for cases when the Remove User action doesn't return an error.
-
Add a child flow logic to assign subflow outputs.
Table 5. Assign Subflow Outputs Name Data Status success The following image shows a completed example of a subflow to reclaim a user subscription. The example shown is the Webex Reclaim Subscription subflow.
-
To test your subflow, click Test.
-
View the test results and system logs for details about any
errors.
To view system logs, navigate to System Logs > System Log > All.
Note: When testing, remember that this subflow deactivates a user. Test this subflow in a sub-production environment. If only a production environment is available, you can create fake users for testing. -
View the test results and system logs for details about any
errors.
-
After verifying that the subflow is working as expected, click
Publish.
Tip: You can still edit the subflow after it's published.