Create a subflow to get user activity
Create a subflow to update the Software Subscription table with each user's most recent activity in the SaaS application.
Before you begin
This subflow requires a data stream action to get user activity. For more information, see Create a data stream action to get user activity.
Role required: flow_designer
About this task
Note: For examples of subflows to get user activity, see the Jira Update User Activity and Webex Update User Activity subflows.
Procedure
Navigate to All > Flow Designer > Designer.
Click New and then select Subflow.
On the form, fill in the fields.
| Field | Value |
|---|---|
| Name | Name of your choice. For example, *Application* Update User Activity, where *Application* is the name of the SaaS application you’re integrating with. |
| Application | Software Asset Management - SaaS License Management Note: If you save the subflow in the Software Asset Management - SaaS License Management 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. |
Click Submit.
Add an integration profile input and a look back time input.
Label Name Type Mandatory Integration profile integration_profile Reference.Integration Profile Yes Look back time look_back_time Date/Time Yes In the Actions section, click the plus icon and then click 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 user activity.
Add the Look back time subflow input as the value to pass to the Look back time input for the data stream action.
Define the values to pass for any user authentication inputs for the data stream action.
Add the Update User Activity If Later Using User action from the Software Asset Management spoke as a child of the get user activity data stream action.
Use values from the Data panel to complete the action.
Field Value Last activity Date of most recent activity from the targetObject. Integration profile Integration profile input that you created for the subflow. External user id User id or account id from the user targetObject. This id is generally a numeric and 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. If you want to use more than one data stream action to get multiple types of user activity, repeat steps 6 through 12 to add each data stream action to the subflow.
Click Test to test your subflow.
View the test results and system logs for details about any errors.
To view system logs, navigate to System Logs > System Log > All.
After verifying that the subflow is working as expected, click Publish.
Tip: You can still edit the subflow after it's published.