CategoriesDataverseDataverse for TeamsPower Platform

Dataverse for Teams – Formula Columns

Formula columns are a powerful feature of Microsoft Dataverse for Teams. With this data type, you can quickly add a calculated column to your table. This is made possible by the Power Fx, a language that enables you to write formulas and expressions that can be used in Dataverse for Teams.

If you still using it, but you have problem with Data columns, go directly here.

Supported data type:

  • Text
  • Decimal Number
  • Yes/No (boolean)
  • Date

Supported operators:

+, -, *, /, %, ^, in, exactin, &

Create it

Let’s start! Go to edito your Dataverse table, and create create new column:

Create column in Dataverse for teams

Select “Formula” Column. In my Example I want to calculate how old employees are. So:

Formula:

DateDiff('BirthYear ', UTCNow(),TimeUnit.Years)
Create column

Result:

Calculated columns result

Problem with Data column

If you get some error, when using Datacolumn , for Example errors about “Time zone conversion”. You should try to edit your Data column and set “Time Zone Adjustment” property to : “Time zone Indipendent

Time zone Indipendent

Available functions

There are about 54 function available at time I’m writing this article, for Example:

DateDiff, DateAdd , If , UTCNow, Abs ecc…

Here complete lists.

Keep mind this attention point from MS: “The Text and Value functions only work with whole numbers, where no decimal separator is involved. The decimal separator varies across locales. Since formula columns are evaluated without locale knowledge, there’s no way to properly interpret or generate the decimal separator.”

Considerations

I hope these information can help you! Here link to official documentations.

Contact me for questions! Have a nice day!

CategoriesDataverseDataverse for TeamsPower Platform

Dataverse – Create Item with Lookup field in Power Automate

Dataverse is a secure platform used for managing and storing data used by business applications. If you’re using Dataverse (or Dataverse for Teams 🙂 ) and your’re trying to creare (or update) row with lookup field, you may can find useful this article.

Initial situation

We have two tables:

  • Customers
  • CustomerContacts

In our table “CustomerContacts” we have two field: Name and Customer, wich is Lookup Column who refers to Customer table.

Tables

I created three record for customer:

Customer table

Table CustomerContracts is empty:

Customer Contacts

Create new customer contact

Let’s assume we need to create through Power Automate (eg for an import from Excel File) our Customer Contacts. How should we do that?

Our Excel File:

Excel File

Let’s see our Flow.

NB: We use “Microsoft Dataverse” actions for both Dataverse and Dataverse for Teams.

Flow with error

This flow don’t need to much explications. We get our Excel File and for each row, we use “Add new row” action to create row. But it doesn’t work. We got this error:

URL was not parsed due to an ODataUnrecognizedPathException. Resource not found for the segment provided in the URL.

We can’t create row using text field (from Excel) in Lookup field.

How can we set Lookup field value?

We need logical name of table and RowId of record we want to refer:

Find internal name of table

Now we can update our flow to use this costruct using Row ID:

cr3e4_customers([ROW_ID])

Or @odata.id directly:

 @odata.id

To get row id, we need get correct items to refer. To do that, we should get logical name of field, before:

Get logical name field.

So our flow become:

Correct flow

In Customer field i wrote:

first(body('List_rows')?['value'])?['@odata.id']

To get first row form “List row actions” (filtered by customer name) and use @data.id value.

Considerations

I hope these information can help you!

Contact me for questions! Have a nice day!

My Agile Privacy
This website uses technical and profiling cookies. Clicking on "Accept" authorises all profiling cookies. Clicking on "Refuse" or the X will refuse all profiling cookies. By clicking on "Customise" you can select which profiling cookies to activate.
Warning: some page functionalities could not work due to your privacy choices