Home > Power Automate > Cloud flow | Dataverse Connector | Useful formulas and Syntaxes

Cloud flow | Dataverse Connector | Useful formulas and Syntaxes

In this article, I am going to collate useful Syntaxes and Formulas frequently used in Cloud Flows with Dataverse connector.

Format DateTime:

When working with date and time values in flow, they may look like:

  • 2019-12-06T22:47:23.0798367Z or 2009-06-15T13:45:30Z

You may format these values to look like:

  • 6/15/2009 1:45 PM or Monday, June 15, 2009

This is done by using Date and Time Format Strings passed to the formatDateTime() function.

Example: Following is the formula to convert the ‘CreatedOn’ to ‘MM/dd/yyyy’ format.

  • ‘createdon’ has been retrieved from Flow’s ‘triggerBody()’.

Get Optionset/Choice Label:

  • By default, ‘Optionset/Choice’ field gives the Value not Label.
    • As an example, ‘Gender’ field (i.e., ‘pis_gender’) gives the ‘100000001’ not ‘Male’.
  • To get the Label, read by _{field-schema-name}_label.

Set the Lookup value:

  • To set Lookup field, in the Dataverse’s ‘Add a new row’ and ‘Update a row’ Actions, use following syntax.
    • Entity/TableName(UniqueId)
  • In below example, ‘pis_customers’ is my table name and reading ‘Customer ID’ from TriggerOutputs body.
    • pis_customers(@{triggerOutputs()?[‘body/pis_customerid’]})

Read the Dataverse ‘Trigger Name’:

  • If you have a Dataverse trigger with ‘Change type’ set as ‘Added or Modified or Deleted’.
  • Following is the statement to read the ‘Message’ (i.e., Create or Update or Delete).
    • @{triggerBody()?[‘sdkmessage’]}

Get Length of the Rows:

  • To get the Count of the records, following is the syntax:
    • @{length(outputs(‘GetAssociatedCars’)?[‘body/value’])}

🙂

Categories: Power Automate Tags: ,
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: