{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":25768,"path":"it-asset-management/saas-license-management/create-subflow-reclaim-user.md","title":"Create a subflow to reclaim a user","bundle":null,"doc_type":null,"release":"australia","body":"\n# Create a subflow to reclaim a user\n\nCreate a subflow to reclaim a user subscription.\n\n## Before you begin\n\nThis subflow requires an action to remove a user. For more information, see [Create an action to remove a user](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/it-asset-management/saas-license-management/create-data-stream-remove-user.md).\n\nRole required: flow\\_designer\n\n## About this task\n\n**Note:** For examples of subflows to reclaim a user, see the Jira Reclaim Subscription and Webex Reclaim Subscription subflows.\n\n## Procedure\n\n1.  Navigate to **All** &gt; **Flow Designer** &gt; **Designer**.\n\n2.  Click **New** and then select **Subflow**.\n\n3.  On the form, fill in the fields.\n\n<table id=\"table_dk4_brb_njb\"><thead><tr><th>\n\nField\n\n</th><th>\n\nValue\n\n</th></tr></thead><tbody><tr><td>\n\nName\n\n</td><td>\n\nName of your choice. For example, *Application* Reclaim Subscription, where *Application* is the name of the SaaS application you are integrating with.\n\n</td></tr><tr><td>\n\nApplication\n\n</td><td>\n\n**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.\n\n</td></tr><tr><td>\n\nAccessible From\n\n</td><td>\n\n**All application scopes**.\n\n</td></tr><tr><td>\n\nCategory\n\n</td><td>\n\nLeave this field empty.\n\n</td></tr><tr><td>\n\nProtection\n\n</td><td>\n\n**None**.\n\n</td></tr><tr><td>\n\nIn-Flow Annotation\n\n</td><td>\n\nLeave this field empty.\n\n</td></tr><tr><td>\n\nDescription\n\n</td><td>\n\nDescription of your choice.\n\n</td></tr><tr><td>\n\nRun As\n\n</td><td>\n\n**User who initiates session**.\n\n</td></tr></tbody>\n</table>4.  Add an integration profile input and a user subscription input.\n\n    |Label|Name|Type|Mandatory|\n    |-----|----|----|---------|\n    |Integration profile|integration\\_profile|Reference.Integration Profile|Yes|\n    |User subscription|user\\_subscription|Reference.Software Subscription|Yes|\n\n5.  Add an error message output and a status output.\n\n    |Label|Name|Type|\n    |-----|----|----|\n    |Error message|error\\_message|String|\n    |Status|status|String|\n\n6.  In the Actions section, click the plus icon and then click **Action** to add a new action.\n\n7.  In the list of installed spokes, select the spoke for the SaaS application that you're integrating with.\n\n    **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://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/integrate-applications/spokes-list.md). If there's no existing spoke for the SaaS application that you want to integrate with, you can [create a new spoke](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/it-asset-management/saas-license-management/create-saas-spoke.md).\n\n8.  To remove a user, select an action.\n\n    1.  Define the value to pass as the **User ID** input.\n\n        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.\n\n    2.  Define the values to pass for any user authentication inputs for the action.\n\n9.  To check if the Remove User action returns an error, add an If flow logic.\n\n10. Add a child flow logic to assign subflow outputs.\n\n    |Name|Data|\n    |----|----|\n    |Error message|Error message output from the Remove User action|\n    |Status|failure|\n\n11. 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.\n\n12. Add a child flow logic to assign subflow outputs.\n\n    |Name|Data|\n    |----|----|\n    |Status|success|\n\n    The following image shows a completed example of a subflow to reclaim a user subscription. The example shown is the Webex Reclaim Subscription subflow.\n\n    \\[Omitted image \"slc-remove-user-flow.png\"\\] Alt text: Example subflow to reclaim a user subscription\n\n13. To test your subflow, click **Test**.\n\n    1.  View the test results and system logs for details about any errors.\n\n        To view system logs, navigate to **System Logs** &gt; **System Log** &gt; **All**.\n\n    **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.\n\n14. After verifying that the subflow is working as expected, click **Publish**.\n\n    **Tip:** You can still edit the subflow after it's published.\n\n\n"}}