activities
latest
false
UiPath logo, featuring letters U and I in white
Classic Integrations Activities
Last updated Nov 8, 2024

ServiceNow Application Scope

UiPath.ServiceNow.Activities.ServiceNowScopeActivity

Tip: While the ServiceNow Application Scope activity can use standard authentication (UserName) and (Password), it is highly recommend to use OAuth security for all your connections per the steps below.

The ServiceNow activities uses the OAuth 1.0 protocol to establish an authenticated connection between UiPath and your ServiceNow instance. This connection authorizes a Robot to call the ServiceNow APIs and access resources on your behalf.

To enable authorization, you create an OAuth application endpoint to your ServiceNow instance. Creating this endpoint generates an OAuth client application record, Client ID, and Client Secret to enable authenticated access to your instance.

After creating your endpoint, you enter your ServiceNow credentials along with the application endpoint URL, Client ID, and Client Secret in the ServiceNow Application Scope activity.

Tip:

Integration user roles should only be assigned the minimum necessary permissions for performing the tasks enabled by the activities in this package (e.g., admin, itil, soap_ecc, and etc. should not be used for integration user roles). Inbound web services that modify tables, should be restricted to the appropriate system roles.

For more information, see the Roles section in the ServiceNow documentation.

How it works

The following steps and message sequence diagram is an example of how the activity works from design time (i.e., the activity dependencies and input/output properties) to run time.

  1. Complete the Setup steps.
  2. Add a activity for each SecureString input property (e.g., two total - one for Password and one for ClientSecret)
  3. Add the ServiceNow Application Scope activity to your project.
  4. Enter values for the Authentication and Connection properties.
  5. Create and enter a IConnection variable for Output properties.
    • You can use this variable in subsequent uses of the ServiceNow Application Scope activity.



If you encounter issues using standard authentication, please see Standard Authentication Tips.

In the Body of the Activity

To build your project and enable the Object Wizard in other activities, you must use the Connection Wizard by clicking the Configure button.

To learn more, see the Wizards section in the About page.

Properties

Authentication
  • Username - The username for your ServiceNow instance. Enter a String variable.
    • This value may be different from your ServiceNow account if you have multiple instances.
    • The Username is associated with the Password. It's recommended that you generate a String variable by following the Create Credential Assets section of the Setup guide.
    • To enter your String variable, use a activity that outputs your Credential Asset (see example below).
  • Password - The password (associated with the Username) to your ServiceNow instance. Enter a String or String variable.
    • This value may be different from your ServiceNow account if you have multiple instances.
    • The Username is associated with the Password. It's recommended that you generate a String variable by following the Create Credential Assets section of the Setup guide.
    • To enter your String variable, use a activity that outputs your Credential Asset (see example below).
  • Client Secret - The SecureString used to authorize communications between UiPath and your ServiceNow instance. Enter a SecureString variable.
    • The ClientSecret gets generated for your ServiceNow instance when you complete an application registry. For more information, see the Setup OAuth section of the Setup guide.
    • To generate a SecureString variable, see the Create Credential Assets section of the Setup guide.
    • To enter your SecureString variable, use a activity that outputs your Credential Asset (see example below).
  • ClientId - The auto-generated, unique ID of your application registry. Enter a String variable.
    • The ClientId gets generated for your ServiceNow instance when you complete an application registry. For more information, see the Setup OAuth section of the Setup guide.
    • The ClientId is associated with the ClientSecret. It's recommended that you generate a String variable by following the Create Credential Assets section of the Setup guide.
    • To enter your String variable, use a activity that outputs your Credential Asset (see example below).
  • Local Port (Optional) - The local port for redirect. Default value is 10001. Enter a String or String variable.
  • Use OAuth 2.0 - Check this to use OAuth2 code grant flow of ServiceNow.
Common
  • DisplayName - The display name of the activity. Enter a String or String variable.
Connection
  • EndpointURL - The URL of your ServiceNow instance. Enter a String or String variable. The URL should be to your ServiceNow instance and not the Redirect URL in your application registry.
Misc
  • Private - If selected, the values of variables and arguments are no longer logged at Verbose level.
Options
  • ReportApiErrorAsException - When selected, API error responses are reported in BusinessActivityExecutionException by all child activities that use this application scope. When cleared, the child activity populates the API error message in the ResponseStatus output property and workflow execution continues. Check the ResponseStatus property to confirm successful execution.
Output
  • ServiceNowConnection - A record of your established connection that you can use in subsequent ServiceNow Application Scope activities. Enter a IConnection variable (UiPath.BAF.Models.Connection.IConnection).
Use Existing Connection
  • ExistingServiceNowConnection - A connection record from a parent ServiceNow Application Scope activity that you can use instead of establishing a new connection. Enter a IConnection variable (UiPath.BAF.Models.Connection.IConnection).
    • The IConnection variable must be from a previously run SeriviceNow Scope activity (parent) that still has an active connection.
    • If you're unable to establish a connection using this property, try re-running your parent ServiceNow Application Scope activity.

Example

The following image shows an example of the activity dependency relationship and input/output property values.

For step-by-step instructions and examples, see the Quickstart guide.



Standard Authentication Tips

In the ServiceNow activity pack, the Basic Authentication (username and password) can be used to run activities. The steps are delineated below:

Design Time

At Design Time enter the username and password with the endpoint URL and these details are saved. Note that the credentials are not validated with ServiceNow for basic authentication at the scope level. Only at a later stage when ServiceNow entities are fetched in an individual activity or at run time while running an activity are these basic authentication credentials used to authenticate.



If the basic authentication credentials provided are incorrect, then while loading the entity list an error will be thrown as it uses the saved basic authentication credentials to connect to ServiceNow and get entities/table names.



If the credentials (Username, Password, EndpointUrl) are correct the entities will be populated in the activity dropdown like below:



Runtime

Make sure the credentials are populated in the properties pane on the right.



If the credentials are correct the activity will run. If incorrect it will throw error at run time as shown below:



  • How it works
  • Properties
  • Example
  • Standard Authentication Tips

Was this page helpful?

Get The Help You Need
Learning RPA - Automation Courses
UiPath Community Forum
Uipath Logo White
Trust and Security
© 2005-2024 UiPath. All rights reserved.