---
sourceDocument: Xanadu IT Asset Management
sourceDocumentLink: https://www.servicenow.com/docs/r/xanadu/it-asset-management

 Release :

    - xanadu

ft:locale :

    - en-US

ft:publication_title :

    - Xanadu IT Asset Management

ft:clusterId :

    - itam

bundleId :

    - itam

workflow :

    - Technology


---

# Create a subflow to reclaim a user

# Create a subflow to reclaim a user {#ariaid-title1}

* Release version: Xanadu
* 
* Updated August 1, 2024
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 2 minutes to read

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](https://www.servicenow.com/docs/6t_H16OvMqyoQ~GyNUByDg "Create an action to deactivate or delete a user account in the SaaS application.").

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

1. Navigate to AllFlow DesignerDesigner.
2. Click New and then select Subflow.
3. On the form, fill in the fields.  
   {#create-subflow-reclaim-user__table_dk4_brb_njb__entry__2}

   | Field | Value |
   |-|-|
   | Name | Name of your choice. For example, <var class="keyword varname">Application</var> Reclaim Subscription, where <var class="keyword varname">Application</var> 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. |
   [Table 1. Subflow Properties form]

   {#create-subflow-reclaim-user__table_dk4_brb_njb}
4. Add an integration profile input and a user subscription input.  
   {#create-subflow-reclaim-user__table_uss_5qb_njb__entry__4}

   | Label | Name | Type | Mandatory |
   |-|-|-|-|
   | Integration profile | integration_profile | Reference.Integration Profile | Yes |
   | User subscription | user_subscription | Reference.Software Subscription | Yes |
   [Table 2. Inputs]

   {#create-subflow-reclaim-user__table_uss_5qb_njb}
5. Add an error message output and a status output.  
   {#create-subflow-reclaim-user__table_ld2_p4w_njb__entry__3}

   | Label | Name | Type |
   |-|-|-|
   | Error message | error_message | String |
   | Status | status | String |
   [Table 3. Outputs]

   {#create-subflow-reclaim-user__table_ld2_p4w_njb}
6. In the Actions section, click the plus icon and then click Action to add a new action.
7. 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](https://store.servicenow.com). For a complete list of available spokes, see [IntegrationHub
   available spokes](https://www.servicenow.com/docs/access?context=spokes-list&version=xanadu&pubname=xanadu-integrate-applications&ft:locale=en-US). If there's no existing spoke for the SaaS application that you want to integrate with, you can [create a new spoke](https://www.servicenow.com/docs/lSHXprskd07sa1R9LR7DdQ "To set up a custom integration in SaaS License Management, create a spoke to connect with a SaaS application.").
8. To remove a user, select an action.
   1. 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.
   2. Define the values to pass for any user authentication inputs for the action.
   {#create-subflow-reclaim-user__substeps_p2j_2tb_tjb}
9. To check if the Remove User action returns an error, add an If flow logic.
10. Add a child flow logic to assign subflow outputs.  
    {#create-subflow-reclaim-user__table_lgx_5wb_tjb__entry__2}

    | Name | Data |
    |-|-|
    | Error message | Error message output from the Remove User action |
    | Status | failure |
    [Table 4. Assign Subflow Outputs]

    {#create-subflow-reclaim-user__table_lgx_5wb_tjb}
11. 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.
12. Add a child flow logic to assign subflow outputs.  
    {#create-subflow-reclaim-user__table_opv_bxb_tjb__entry__2}

    | Name | Data |
    |-|-|
    | Status | success |
    [Table 5. Assign Subflow Outputs]

    {#create-subflow-reclaim-user__table_opv_bxb_tjb}

    The following image shows a completed example of a subflow to reclaim
    a user subscription. The example shown is the Webex Reclaim
    Subscription subflow.
13. To test your subflow, click Test.
    1. View the test results and system logs for details about any errors.  
       To view system logs, navigate to System LogsSystem LogAll.

    {#create-subflow-reclaim-user__substeps_ulb_kgz_zjb}  
    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.
14. After verifying that the subflow is working as expected, click Publish.  
    Tip:  
    You can still edit the subflow after it's published.
**Previous topic:** [Create an action to remove a user](https://www.servicenow.com/docs/6t_H16OvMqyoQ~GyNUByDg "Create an action to deactivate or delete a user account in the SaaS application.")  
**Next topic:** [Create a subflow to get license consumption](https://www.servicenow.com/docs/GQZaekUG7d4gXwrjVwTY7A "Create a subflow to add license consumption data to the Subscription Consumption Summaries [sam_saas_consumption_summary] table.")

*[\>]: and then


