0% found this document useful (0 votes)
17 views

power-automate-dataverse-cheat-sheet-v1.0-3

This cheat sheet provides essential tips and best practices for using the Power Automate Dataverse Connector, including filtering techniques, expression functions, and email message handling. It emphasizes the importance of naming conventions, scope control for managing actions, and checking API calls for efficiency. Additionally, it offers guidance on displaying lookup fields and option set names, as well as ensuring flows are well-documented and tested.

Uploaded by

Marco
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views

power-automate-dataverse-cheat-sheet-v1.0-3

This cheat sheet provides essential tips and best practices for using the Power Automate Dataverse Connector, including filtering techniques, expression functions, and email message handling. It emphasizes the importance of naming conventions, scope control for managing actions, and checking API calls for efficiency. Additionally, it offers guidance on displaying lookup fields and option set names, as well as ensuring flows are well-documented and tested.

Uploaded by

Marco
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Power Automate – Dataverse Connector Cheat Sheet

V1.0 Created by Areti Iles (aretiiles.com) – Last Updated August 2023

Useful Links
• Using Power Automate • Filter Examples • HTML Basics
with Dataverse • Expressions Guide • Connectors Info
• Approval Flows • OData Queries

Filtering
• If filtering against a lookup field the format needs to be _field schema_value e.g. ‘_accountid_value’
• In the below example we are using the ‘List rows’ action to list Contacts that have a specific parent
account and are active:

• When listing or getting records, apart from using filtering make sure you also specify which columns
you need by adding the schema names in the ‘Select columns’ otherwise the whole table is fetched
which is unnecessary (and slows things down).

Expand Query
• Useful for getting data from a related table without having to use an additional action
• For example below we are using the ‘Get a row by ID’ action to get a single Opportunity record but
also at the same time the Opportunity Owner’s first and last names (which ‘live’ in the System Users
table):
Expression Functions
• Used when data needs to be edited or calculated – there are LOADS, see here!
• In the below example we are using the simple ‘addDays’ expression to calculate the Due Date of a task
to be 2 days after an Opportunity is created:

• A useful one is ‘utcNow()’ that you can use to identify if something is before or after ‘now/today’ – for
example you can use this in a filter to check if an Opportunity’s estimated close date is in the past (and
if so chase the sales team!):

• If you need to convert ‘utcNow’ to a specific time zone to get an ‘accurate’ time, you can use the
‘Convert time zone’ action and then use the output of that where you need it:
Checking a List has results
• Useful for adding a condition after you use the ‘List rows’ action to check that there are actually results
for your filters before continuing to do something with those results
• The condition needs to check either that the ‘length’ of the output is not 0 (i.e. something has been
returned) or you can also use the ‘empty()’ function which returns true or false – both work:

Or….

I personally prefer using the empty function as it makes it more obvious what is happening in that step!

Displaying a Lookup or Option Set Field’s ‘Name’


• Applies to lookup fields and option set fields where you want to use the ‘name’ of it (what appears in
the UI) rather than the value in the database, e.g.:
o To show the Owner ‘name’ against an Opportunity record you would need:

outputs('Step_Name')?['body/[email protected]']

o To show an option set’s option name rather than the value you would need:
outputs('Step_Name')?['body/_fieldschemaname_label']
The above would be added as an expression to the relevant place where you need them – for example I have
added the Account Owner (lookup) and Account Relationship Type (option set) in the description of this task:
Email Messages
• When using the ‘Add a new row’ action to create an Email Message, the message can be saved in
Dataverse and linked to other records (e.g. a Opportunity) and appear in that record’s timeline
• In the example below the email is being sent following an approval process and therefore we are using
an Environment Variable to store the System User GUID for the account that is used to send automated
system emails across multiple flows:

Use this to add If sending to multiple people or a team


multiple ‘To’s as you can use queues in the From/To here
well as CCs as instead of systemusers
needed

You don’t have to use HTML here


but if you do the email will look a
lot better and properly spaced out
etc. Otherwise, it will just be plain
text. Use HTML If adding a
hyperlink to the
record in the
email, use an
environment
variable for the
Helps differentiate between
environment’s
automatically created emails
URL so that the
and manual/user ones but
link continues to
strictly speaking you don’t
work across
have to set this
environments
(Dev/Test/Prod)
• The above will only create an Email Message record, it won’t send it. To send the email message you
will need to add a ‘Perform a bound action’ action for the Email Messages table below it selecting the
SendEmail action and setting the IssueSend to Yes:

Scope Control
• Recommended for use in flows to record and manage exceptions and grouping actions together and
provide structure and improve the readability of flows (especially larger/longer ones!)

• Remember to rename the ‘Scope’ control to describe the behaviour of the actions inside it
• The Scope control appears as a brown box and allows multiple actions to be added within it – you can
then use parallel branching and ‘Configure after’ settings for success, failure, if it was skipped or timed
out known as a ‘Try, Catch’ approach:

• You can use multiple Scope controls within a flow to ensure e.g. that a group of actions only executes
after another group of actions is successful and so on.
Best Practices
• Name your flow – at a glance the name should provide the trigger and overall purpose e.g. Account –
Update associated Contacts when Address Changes
• Name your triggers/actions – explain what each one is doing (but remember special characters are not
allowed). ‘When a row is added, modified or deleted’ means nothing to anyone. ‘When an Opportunity
is created’ does

• Add comments or notes - e.g. if you are using an option set value (100012), explain which option it
appears as in the UI in the notes against that action. Add comments to the flow in general to explain
what it does/why it’s there

• Check your API Calls - only query for and fetch what you need, and check flow ownership
• Use Variables – either environment or flow-specific ones, do not hard code anything. The data type
should be included in the variable name (e.g. EnvironmentURLString)
• Test it – goes without saying, check any errors in the Flow checker and use the Test function:

Want something added to the cheat sheet(s) or have a question? Let me know!

You might also like