Difference between revisions of "Dataverse Connector"

From Power Wiki
Jump to navigation Jump to search
Line 15: Line 15:
 
* If you want a value from the first item, use this expression <i>first(body('List_rows')?['value'])?['name']</i> to look for attribute name.
 
* If you want a value from the first item, use this expression <i>first(body('List_rows')?['value'])?['name']</i> to look for attribute name.
 
* If you want to know the number of rows retrieved, use this expression <i>length(body('List_rows')?['value'])</i> To be used e.g. in a condition if you want to verify that you got exactly one row back for instance.
 
* If you want to know the number of rows retrieved, use this expression <i>length(body('List_rows')?['value'])</i> To be used e.g. in a condition if you want to verify that you got exactly one row back for instance.
 +
 +
* [https://d365demystified.com/2020/05/20/get-count-of-records-retrieved-in-cds-connector-in-a-flow-power-automate/ Get Count of records retrieved in CDS connector in a Flow | Power Automate] by Priyesh Wagh
  
 
Remember to use your own name of the step instead of 'List_rows'.  
 
Remember to use your own name of the step instead of 'List_rows'.  

Revision as of 12:31, 8 February 2022

The Dataverse Connector is used in Power Automate cloud flows to connect to your Dataverse data. This page gathers tips and tricks.

Tips and tricks

Set lookup value

You cannot simply use the guid to set a lookup, you need to add also the entity name in front of it, e.g. /contacts(guid) for setting a lookup to a contact.

List Rows

After using List Rows you might want to verify the result, here are a few examples which might be handy. To be used e.g. a Condition Step or in a Compose or Variable step.

  • If you want to check if there was no rows returned, use this expression empty(body('List_rows')?['value']) in a condition. If that is equal to true - means no rows returned.
  • If you want a value from the first item, use this expression first(body('List_rows')?['value'])?['name'] to look for attribute name.
  • If you want to know the number of rows retrieved, use this expression length(body('List_rows')?['value']) To be used e.g. in a condition if you want to verify that you got exactly one row back for instance.

Remember to use your own name of the step instead of 'List_rows'.

Get labels of Choices