Skip to content
Release: Australia · Updated: 2026-03-12 · Official documentation · View source

Create a subflow to get users

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

About this task

Note: For examples of subflows to get users, see the Jira Download Subscriptions and Webex Download Subscriptions subflows.

Procedure

  1. Navigate to All > Flow Designer > Designer.

  2. Select New and then select Subflow.

  3. On the form, fill in the fields.

FieldValue
NameName of your choice. For example, `Application` Download Subscriptions, where `Application` is the name of the SaaS application that you're integrating with.
ApplicationSoftware Asset Management - SaaS License Management
Accessible FromSelect All application scopes.
CategoryLeave this field empty.
ProtectionSelect None.
In-Flow AnnotationLeave this field empty.
DescriptionDescription of your choice.
Run AsUser who initiates session.
  1. Select Submit.

  2. Add an integration profile input.

    LabelNameTypeRequired
    Integration profileintegration_profileReference.Integration ProfileYes
  3. In the Actions section, select the plus icon and then select Action to add a new action.

  4. 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.

  5. Select a data stream action to get users.

  6. 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.

FieldValue
External user idUser id or account id from the user targetObject. This is generally a numeric, non human-readable value. This value must be unique.
User principal nameEmail 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 profileIntegration profile input that you created for the subflow.
Last ActivityDate of most recent activity from the user targetObject. For example, the last login time.
External createdAccount 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.
IdentifierA 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 attributesThis is used to update any other field on the Software Subscriptions \[samp\_sw\_subscription\] table that’s not mentioned earlier.
  1. To test your subflow, select Test.

    1. 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.

  2. 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

Role required: sam_admin

Procedure

  1. Create a custom product when your product doesn't exist in the Software Product [samp_sw_product] table.

    1. Select New.

    2. On the form, fill in the fields.

FieldDescription
PublisherPublisher of the custom product.
ProductName of the custom product.
Product typeProduct type of the custom software product.
Product classificationOfficial UNSPSC classification.
Subscription softwareOption indicating that your product is a subscription-based product.
Ignore installsOption 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 serviceOption that indicates that the product will be excluded from the content service.You must not select this check box.
ActiveOption indicating that this product is used or not.
3.  Select **Submit**.
  1. Create a custom discovery map by creating a custom entitlement definition from the Discovery maps [samp_custom_sw_entitlement_definition] table.

    1. Select New.

    2. On the form, fill in the fields.

FieldDescription
ProductCurrent software product name. Custom product that you created in step 1.
Version conditionCondition qualifier for the Version field:- starts with - is - is anything Default is is anything.
VersionVersion of the software product. Required if version condition value is starts with or is.
Edition conditionCondition qualifier for the Edition field:- starts with - is - is anything Default is is anything.
EditionPlatform of the software product to use when searching for the normalized discovery model.
PlatformPlatform of the software product to use when searching for the normalized discovery model.
LanguageLanguage of the software product to use when searching for the normalized discovery model, which is populated once it has been normalized or added manually.
3.  Select **Submit**.
  1. 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.

    1. Select New.

    2. On the form, fill in the fields.

FieldDescription
IdentifierSubscription identifier that is related with the custom product.
Subscription integrationList 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 definitionCustom discovery map that you created in step 2.
ActiveCheck box indicating the identifier is used or not.
3.  Select **Submit**.