{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":25767,"path":"it-asset-management/saas-license-management/create-subflow-get-users.md","title":"Create a subflow to get users","bundle":null,"doc_type":null,"release":"australia","body":"\n# Create a subflow to get users\n\nCreate a subflow to add a list of users to the Software Subscription table.\n\n## Before you begin\n\nThis subflow requires a data stream action to get users. For more information, see [Create a data stream action to get users](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/it-asset-management/saas-license-management/create-data-stream-action-slc.md).\n\nRole required: flow\\_designer\n\n## About this task\n\n**Note:** For examples of subflows to get users, see the Jira Download Subscriptions and Webex Download Subscriptions subflows.\n\n## Procedure\n\n1.  Navigate to **All** &gt; **Flow Designer** &gt; **Designer**.\n\n2.  Select **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` Download Subscriptions, where `Application` is the name of the SaaS application that you're integrating with.\n\n</td></tr><tr><td>\n\nApplication\n\n</td><td>\n\nSoftware Asset Management - SaaS License Management\n\n</td></tr><tr><td>\n\nAccessible From\n\n</td><td>\n\nSelect **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\nSelect **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\nUser who initiates session.\n\n</td></tr></tbody>\n</table>4.  Select **Submit**.\n\n5.  Add an integration profile input.\n\n    |Label|Name|Type|Required|\n    |-----|----|----|--------|\n    |Integration profile|integration\\_profile|Reference.Integration Profile|Yes|\n\n6.  In the Actions section, select the plus icon and then select **Action** to add a new action.\n\n7.  Select the spoke for the SaaS application that you want to integrate with from the list of installed spokes.\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.  Select a data stream action to get users.\n\n9.  Define the values to pass for any user authentication inputs for the data stream action.\n\n    The data stream action might return users that you don't want to include in your list of user subscriptions. If you perform filtering to exclude some users, add an If flow logic as a child of the get users data stream action.\n\n    The amount of filtering required, if any, depends on the application you're integrating with. For example, if the user targetObject has an **active** property, you could add a condition to check that the value is **true** to confirm that the subflow doesn't download deactivated users. An example of filtering used by the Jira Download Subscriptions subflow is that the account type can’t be **app** to help prevent the subflow from returning accounts that aren’t actual users.\n\n    Add conditions to the If flow logic for any required filtering.\n\n    -   If you're using an If flow logic to filter users, add the **Upsert user subscription using subscription identifier** action from the Software Asset Management spoke as a child of the flow logic.\n    -   If you're not filtering users, add the **Upsert user subscription using subscription identifier** action as a child of the get users data stream action. This action adds the SaaS application user subscription to the Software Subscription table \\[samp\\_sw\\_subscription\\]. If the subscription is already in the table, the action updates the subscription record.\n10. Fill in the inputs that are applicable to your integration.\n\n    Use values from the data panel to fill in the action inputs. Your ask to the SaaS API might not return data for all the inputs.\n\n<table id=\"table_cch_lsr_njb\"><thead><tr><th>\n\nField\n\n</th><th>\n\nValue\n\n</th></tr></thead><tbody><tr><td>\n\nExternal user id\n\n</td><td>\n\nUser id or account id from the user targetObject. This is generally a numeric, non human-readable value. This value must be unique.\n\n</td></tr><tr><td>\n\nUser principal name\n\n</td><td>\n\nEmail address from the user targetObject. If an email address isn’t available, use another value such as user name plus user id. This value should be human readable.\n\n</td></tr><tr><td>\n\nIntegration profile\n\n</td><td>\n\nIntegration profile input that you created for the subflow.\n\n</td></tr><tr><td>\n\nLast Activity\n\n</td><td>\n\nDate of most recent activity from the user targetObject. For example, the last login time.\n\n</td></tr><tr><td>\n\nExternal created\n\n</td><td>\n\nAccount creation date from the user targetObject.\n\n This value helps create better reclamation candidates. A new user might not have any activity yet. If the record shows that the user account was created, a reclamation candidate isn't created for that user because it's a new account rather than an unused account.\n\n</td></tr><tr><td>\n\nIdentifier\n\n</td><td>\n\nA unique identifier to identify the integration. Software models are automatically created for subscription with an identifier that matches an identifier in the Subscription Product Definitions \\[samp\\_sw\\_subscription\\_product\\_definition\\] table.\n\nIf an identifier doesn't exist, configure an identifier. For more information, see [Configure an identifier](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/it-asset-management/saas-license-management/create-subflow-get-users.md).\n\n</td></tr><tr><td>\n\nAdditional attributes\n\n</td><td>\n\nThis is used to update any other field on the Software Subscriptions \\[samp\\_sw\\_subscription\\] table that’s not mentioned earlier.\n\n</td></tr></tbody>\n</table>11. To test your subflow, select **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:** The data stream action to get users should retrieve multiple pages of users successfully. Don't write to the Software Subscriptions \\[samp\\_sw\\_subscription\\] table until you verify that the data stream action retrieves all users. To verify, you can make a subflow that consumes the data stream and log the results.\n\n12. After verifying that the subflow is working as expected, select **Publish**.\n\n    **Tip:** You can still edit the subflow after it's published.\n\n\n## Configure an identifier\n\nConfigure an identifier if it doesn't exist to identify an integration.\n\n### Before you begin\n\nRole required: sam\\_admin\n\n### Procedure\n\n1.  Create a custom product when your product doesn't exist in the Software Product \\[samp\\_sw\\_product\\] table.\n\n    1.  Select **New**.\n\n    2.  On the form, fill in the fields.\n\n<table id=\"table_gnp_l4q_xvb\"><thead><tr><th>\n\nField\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nPublisher\n\n</td><td>\n\nPublisher of the custom product.\n\n</td></tr><tr><td>\n\nProduct\n\n</td><td>\n\nName of the custom product.\n\n</td></tr><tr><td>\n\nProduct type\n\n</td><td>\n\nProduct type of the custom software product.\n\n</td></tr><tr><td>\n\nProduct classification\n\n</td><td>\n\nOfficial UNSPSC classification.\n\n</td></tr><tr><td>\n\nSubscription software\n\n</td><td>\n\nOption indicating that your product is a subscription-based product.\n\n</td></tr><tr><td>\n\nIgnore installs\n\n</td><td>\n\nOption indicating that the product type is licensable. This check box is displayed only if you select Product type as Licensable and Subscription software is set to true.\n\n</td></tr><tr><td>\n\nExclude from content service\n\n</td><td>\n\nOption that indicates that the product will be excluded from the content service.You must not select this check box.\n\n</td></tr><tr><td>\n\nActive\n\n</td><td>\n\nOption indicating that this product is used or not.\n\n</td></tr></tbody>\n</table>    3.  Select **Submit**.\n\n2.  Create a custom discovery map by creating a custom entitlement definition from the Discovery maps \\[samp\\_custom\\_sw\\_entitlement\\_definition\\] table.\n\n    1.  Select **New**.\n\n    2.  On the form, fill in the fields.\n\n<table id=\"table_xfz_dpq_xvb\"><thead><tr><th>\n\nField\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nProduct\n\n</td><td>\n\nCurrent software product name. Custom product that you created in [step 1](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/it-asset-management/saas-license-management/create-subflow-get-users.md).\n\n</td></tr><tr><td>\n\nVersion condition\n\n</td><td>\n\nCondition qualifier for the Version field:-   starts with\n-   is\n-   is anything\n Default is **is anything**.\n\n</td></tr><tr><td>\n\nVersion\n\n</td><td>\n\nVersion of the software product. Required if version condition value is starts with or is.\n\n</td></tr><tr><td>\n\nEdition condition\n\n</td><td>\n\nCondition qualifier for the Edition field:-   starts with\n-   is\n-   is anything\n Default is **is anything**.\n\n</td></tr><tr><td>\n\nEdition\n\n</td><td>\n\nPlatform of the software product to use when searching for the normalized discovery model.\n\n</td></tr><tr><td>\n\nPlatform\n\n</td><td>\n\nPlatform of the software product to use when searching for the normalized discovery model.\n\n</td></tr><tr><td>\n\nLanguage\n\n</td><td>\n\nLanguage of the software product to use when searching for the normalized discovery model, which is populated once it has been normalized or added manually.\n\n</td></tr></tbody>\n</table>    3.  Select **Submit**.\n\n3.  Create a custom subscription product definition by creating a custom entitlement definition from the Custom Subscription Product Definitions \\[samp\\_sw\\_custom\\_subscription\\_product\\_definition\\] table.\n\n    1.  Select **New**.\n\n    2.  On the form, fill in the fields.\n\n<table id=\"table_gdg_4pq_xvb\"><thead><tr><th>\n\nField\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nIdentifier\n\n</td><td>\n\nSubscription identifier that is related with the custom product.\n\n</td></tr><tr><td>\n\nSubscription integration\n\n</td><td>\n\nList of SaaS and SSO providers that is mapped to subscription products in the Subscription Product Definition \\[samp\\_sw\\_subscription\\_product\\_definition\\] table. For this scenario, select **Custom Integration**.\n\n</td></tr><tr><td>\n\nEntitlement definition\n\n</td><td>\n\nCustom discovery map that you created in [step 2](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/it-asset-management/saas-license-management/create-subflow-get-users.md).\n\n</td></tr><tr><td>\n\nActive\n\n</td><td>\n\nCheck box indicating the identifier is used or not.\n\n</td></tr></tbody>\n</table>    3.  Select **Submit**.\n\n\n"}}