How to Take Record URL Dynamically Using Power Automate

```html

How to Take Record URL Dynamically Using Power Automate

In many business processes, users need direct access to records created or updated within Dynamics 365, Dataverse, or Model-Driven Apps.

Instead of manually searching for records, Power Automate can dynamically generate record URLs and include them in emails, Teams notifications, approval requests, and automated workflows.

This significantly improves user experience and reduces navigation time.


Why Generate Record URLs Dynamically?

Dynamic record URLs help users:

Example:

Instead of sending:

A new Case has been created.

Send:

A new Case has been created.

Click here to open the record.

Common Business Scenarios

Approval Workflows

Send direct links to approvers.

Case Management

Open support cases directly.

Lead Management

Navigate to newly created leads.

Opportunity Tracking

Open opportunities from notifications.

Employee Requests

Access records instantly from emails.


Understanding Dynamics 365 Record URLs

Every Dataverse record contains:

Environment URL
+
App ID
+
Entity Name
+
Record ID

Example:

https://org.crm.dynamics.com
/main.aspx
?appid=xxxxxxxx
&pagetype=entityrecord
&etn=account
&id=GUID

This URL opens the specific record directly.


Method 1: Use Record URL from Dataverse Trigger

Many Dataverse triggers provide:

Row ID

or

Record ID

Example:

triggerOutputs()?['body/accountid']

This value becomes part of the generated URL.


Method 2: Get Environment URL

Store your environment URL:

https://yourorg.crm.dynamics.com

Create a Compose Action:

https://yourorg.crm.dynamics.com

Or use an Environment Variable.


Method 3: Build Dynamic URL

Expression:

concat(
'https://yourorg.crm.dynamics.com',
'/main.aspx?pagetype=entityrecord&etn=account&id=',
triggerOutputs()?['body/accountid']
)

Result:

https://yourorg.crm.dynamics.com/main.aspx?pagetype=entityrecord&etn=account&id=GUID

Users can click the link directly.


Example: Account Record URL

Entity:

account

Record ID:

accountid

Expression:

concat(
variables('EnvironmentURL'),
'/main.aspx?pagetype=entityrecord&etn=account&id=',
triggerOutputs()?['body/accountid']
)

Output:

Direct Account record URL.


Example: Case Record URL

Entity:

incident

Expression:

concat(
variables('EnvironmentURL'),
'/main.aspx?pagetype=entityrecord&etn=incident&id=',
triggerOutputs()?['body/incidentid']
)

Users can open support cases directly from emails.


Sending URL in Email

Send Email (V2)

Body:

<p>A new record has been created.</p>

<br><br>

<a href='@{outputs('Compose_RecordURL')}'>
Open Record
</a>

Result:

Recipients receive a clickable link.


Sending URL in Teams

Message:

New Opportunity Created

<a href='@{outputs('Compose_RecordURL')}'>
Open Opportunity
</a>

Users can open the record directly from Microsoft Teams.


Example Workflow

Dataverse Trigger
↓
Get Record ID
↓
Generate URL
↓
Send Email
↓
User Opens Record

This is one of the most common Power Automate implementations.


Using App ID for Model-Driven Apps

If multiple apps exist, use:

appid=

Example:

concat(
variables('EnvironmentURL'),
'/main.aspx?appid=',
variables('AppID'),
'&pagetype=entityrecord&etn=account&id=',
triggerOutputs()?['body/accountid']
)

Result:

Record opens in the correct application.


Real-World Example

Lead Assignment Process

When a lead is assigned:

Email:

New Lead Assigned

Open Lead

The salesperson clicks once and begins working immediately.


Common Use Cases


Best Practices


Benefits


Conclusion

Generating record URLs dynamically using Power Automate is a powerful technique for improving productivity and workflow efficiency. By combining environment URLs, entity names, record IDs, and app IDs, organizations can create direct links to Dataverse and Dynamics 365 records, enabling users to access information quickly and efficiently from emails, Teams notifications, approvals, and automated business processes.

```