The Dynamics 365 activities use the OAuth with Common Data Service protocol to establish an authenticated connection between UiPath and your Dynamics 365 application. This connection authorizes a Robot to call the Web APIs and access resources on your behalf.
To enable authentication, you use the Azure Active Directory (AAD) to register your Dynamics 365 application in your account tenant. Registering your application generates an Application (client) ID that's used along with other identifiers to establish authenticated access to your instance. For more information and before you build your first automation project, see the Setup guide.
After completing your application registration, you select the type of authentication that you want to use (AuthenticationType) and enter your Application (client) ID (ClientId), Dynamics 365 application endpoint (EndpointUrl), Directory (tenant) ID (TenantId), and depending on the authentication type that you select, your client secret (CientSecret).
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.
- Complete the Setup steps.
- Add a Get Credential activity if your AuthenticationType is ClientCredentials, otherwise this is N/A.
- For more information, see Credential Management in this guide.
- Add the Microsoft Dynamics Application Scope activity to your project.
- Enter values for the Connection input properties.
- Create and enter a
MicrosoftDynamicsConnectionvariable for Output poperty.
- You can use this variable in subsequent uses of the Microsoft Dynamics Application Scope 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 about the Connection Wizard, see the Business Activity Frameworks page.
Configuring the fields in the Connection Wizard does not populate the Microsoft Dynamics Application Scope properties. The wizard establishes a connection to your Microsoft Dynamics 365 application during design time only; enabling the Object Wizards in the other Microsoft Dynamics 365 activities.
- DisplayName - The display name of the activity. This field supports only
- AuthenticationType - The type of authentication that you want to use to connect to your Dynamics 365 application. Select an item from the drop-down list. There are two options:
- PasswordCredentials - If selected, authentication is done via a user prompt (according to the option that you select in the Prompt property) to enter the password to their Dynamics 365 account. This option is for attended automation only.
- ClientCredentials - If selected, authentication is done via a ClientSecret. This option is for both attended and unattended automation. For more information about client credentials, see Use Client Secrets & Certificates in the Microsoft documentation.
- ClientId - The auto-generated, Application (client) ID assigned to your registered application. This field supports only
- The ClientId gets generated when you register your application using the Azure Active Directory (AAD). For more information, see the Register your application section of the Setup guide.
- If your AuthenticationType value is ClientCredentials, the ClientId is associated with the ClientSecret. Becuase of this relationship, it's recommended that you create a
Stringvariable for this property by following the Create Credential Asset section of the Setup guide.
- To create and enter your
Stringvariable for this property, use a Get Credential activity to output your Credential Asset (see example below).
- ClientSecret - The password (associated with the Username) to your ServiceNow instance. Enter a
- The ClientSecret can be generated when you register your application using the Azure Active Directory (AAD). For more information, see the Create client secret section of the Setup guide.
- To create a
SecureStringvariable, see the Create Credential Asset section of the Setup guide.
- To enter your
SecureStringvariable, use a Get Credential activity that outputs your Credential Asset (see example below).
- EndpointUrl - The URL of the CRM instance that you want to connect to. This field supports only
- Prompt - Specifies the password prompt behavior for the PasswordCredentials authentication. Select an item from the drop-down list. There are three options:
- Auto - The prompt only appears when credentials are necessary.
- SelectAccount - The prompt requires a user to select an account and then enter their credentials (used when there are multiple accounts).
- Always - The prompt appears each time the activity is run (even when there is a token in the cache).
- TenantId - The Directory (tenant) ID assigned to your Azure Active Directory (ADD) tenant. This field supports only
- ExistingMicrosoftDynamicsConnection - A connection record from a parent Microsoft Dynamics Application Scope activity that you can use instead of establishing a new connection. Enter a
MicrosoftDynamicsConnectionvariable must be from a previously run Microsoft Dynamics Application 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 Microsoft Dynamics Application Scope activity.
- Private - If selected, the values of variables and arguments are no longer logged at Verbose level.
- 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.
- MicrosoftDynamicsConnection - A record of your established connection that you can use in other Microsoft Dynamics Application Scope activities that are included in this scope activity. Enter a
MicrosoftDynamicsConnectionvariable. You can pass this variable to a scope activity in a workflow that is invoked from within the parent scope activity.
- For example, you may have 3 workflows. The first includes the parent scope activity that establishes the connection to your registered application (i.e., parent workflow). The second workflow creates a new contact record and the third creates a new account record; both are included in the parent scope activity.
- When the workflows run, the parent scope activity passes the
MicrosoftDynamicsConnectionvariable to the ExistingMicrosoftDynamicsConnection property in the second and third workflows (see image below).
The following image shows an example of the activity dependency relationship and input/output property values.
Updated 28 days ago