Create a subflow to get users
- UpdatedDec 17, 2024
- 5 minutes to read
- Vancouver
- IT Asset Management
Create a subflow to add a list of users to the Software Subscription table.
Before you begin
This subflow requires a data stream action to get users. For more information, see Create a data stream action to get users.
Role required: flow_designer or admin
About this task
Procedure
- Navigate to All > Flow Designer > Designer.
- Select 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 Download Subscriptions, where Application is the name of the SaaS application that you're integrating with.
Application Software Asset Management - SaaS License Management Accessible From Select All application scopes. Category Leave this field empty. Protection Select None. In-Flow Annotation Leave this field empty. Description Description of your choice. Run As User who initiates session. - Select Submit.
-
Add an integration profile input.
Table 2. Inputs Label Name Type Required Integration profile integration_profile Reference.Integration Profile Yes - In the Actions section, select the plus icon and then select Action to add a new action.
-
Select the spoke for the SaaS application that you want to
integrate with from the list of installed spokes.
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.
- Select a data stream action to get users.
-
Define the values to pass for any user authentication inputs for the data
stream action.
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.
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.
Add conditions to the If flow logic for any required filtering.- 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.
- 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.
-
Fill in the inputs that are applicable to your integration.
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.
Table 3. Upsert User Subscription action Field Value External user id User id or account id from the user targetObject. This is generally a numeric, non human-readable value. This value must be unique.
User principal name Email 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.
Integration profile Integration profile input that you created for the subflow. Last Activity Date of most recent activity from the user targetObject. For example, the last login time. External created Account creation date from the user targetObject.
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.
Identifier A 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.
If an identifier doesn't exist, configure an identifier. For more information, see Configure an identifier.
Additional attributes This is used to update any other field on the Software Subscriptions [samp_sw_subscription] table that’s not mentioned earlier. -
To test your subflow, select 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: 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. -
View the test results and system logs for details about any errors.
-
After verifying that the subflow is working as expected, select Publish.
Tip: You can still edit the subflow after it's published.
Configure an identifier
Configure an identifier if it doesn't exist to identify an integration.
Before you begin
Procedure
-
Create a custom product when your product doesn't exist in the Software Product
[samp_sw_product] table.
- Select New.
-
On the form, fill in the fields.
Field Description Publisher Publisher of the custom product. Product Name of the custom product. Product type Product type of the custom software product. Product classification Official UNSPSC classification. Subscription software Option indicating that your product is a subscription-based product. Ignore installs Option 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.
Exclude from content service Option that indicates that the product will be excluded from the content service. You must not select this check box.
Active Option indicating that this product is used or not. - Select Submit.
-
Create a custom discovery map by creating a custom entitlement definition from
the Discovery maps [samp_custom_sw_entitlement_definition] table.
- Select New.
-
On the form, fill in the fields.
Field Description Product Current software product name. Custom product that you created in step 1. Version condition Condition qualifier for the Version field: - starts with
- is
- is anything
Default is is anything.
Version Version of the software product. Required if version condition value is starts with or is.
Edition condition Condition qualifier for the Edition field: - starts with
- is
- is anything
Default is is anything.
Edition Platform of the software product to use when searching for the normalized discovery model. Platform Platform of the software product to use when searching for the normalized discovery model. Language Language of the software product to use when searching for the normalized discovery model, which is populated once it has been normalized or added manually. - Select Submit.
-
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.
- Select New.
-
On the form, fill in the fields.
Field Description Identifier Subscription identifier that is related with the custom product. Subscription integration List 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.
Entitlement definition Custom discovery map that you created in step 2. Active Checkbox indicating the identifier is used or not. - Select Submit.