Using Coalesce Function to handle null value in Power Automate – Dataverse

Recently in one of our flows, we were getting the below error –

InvalidTemplate. Unable to process template language expressions in action ‘List_rows_:_Region’ inputs at line ‘0’ and column ‘0’: ‘The template language function ‘replace’ expects its first parameter ‘string’ to be a string. The provided value is of type ‘Null’. Please see for usage details.’.

One or more fields provided is of type ‘Null’, a different type is expected.

This was because the replace function that we were using for the Filter rows property of List Rows (Dataverse) had the variable value as null.

Below was our dynamics expression where we replaced apostrophe with 2 single quotes –

replace(replace(variables(‘varFieldData’)?[‘myVariable’],‘_’,’ ‘),””,”””)

The solution was to use coalesce function, to replace null with a blank string as shown below.

replace(replace(coalesce(variables(‘varFieldData’)?[‘myVariable’],”),‘_’,’ ‘),””,”””)

Similarly, we can use coalesce function to provide a default value.

The coalesce function will evaluate its arguments in order and will return the first non-blank or non-empty value. If all the arguments are blank or empty strings, the function will return blank.

After using the coalesce function, our flow was successful.


A similar example in SQL –

Hope it helps..


How to – Handle single quote/apostrophe in Filter Rows in Power Automate (Dataverse)

Say for e.g. we have the below flow, which finds the lead having subject as “My Test’s Value”

On running it we get the below error

To make it work we can make use of replace function here.


= to espace

= special character


Please refer to the helpful post-

This time it works successfully.

ChatGPT – quick to correct and give the right answer.

Hope it helps..



Format property missing in Date Picker in custom page – Dataverse / PowerApps

Recently while designing the custom page, we realized that the format property is missing for the Date Picker control. This is because Date Picker control is based on Fluent UI Library.

One option earlier was to enable the Classic Controls from Settings

And replace the existing control with the classic control

Also, check –

Hope it helps..


Fixed – Value must be a data entity record error in Power Apps

We got the below error while trying to use the Relate function – “Value must be a data entity record”






As the error message clearly states and also if we see the syntax, the Relate function expects a record

Below was our formula for OnSelect, which was throwing the error

Here instead of passing the record, we were passing the table in the Relationship which was the reason for the error.

We changed it to store the ThisItem

And also updated the OnSelect

This fixed the issue for us.

Hope this helps..


Fixed – Custom Page not opening or Page doesn’t exist in this app error in the model-driven app (PowerApps)

Recently we created a custom page to be opened from the Ribbon / Command bar, however, the page was not opening for us, even though the function was running properly.

Here we had created the custom page from within the solution area, so we need to add this custom page to our model-driven app. (The other option is to create the page from the Modern App Designer.)

Open the app in the Modern App Designer and click on Add Page

Select Use an exiting custom page, select the page and uncheck the Show in navigation option as we are opening this page from the form.

Publish the app.

This time clicking on Open Custom page command/button on the form successfully opened the custom page for us.

Thanks to Andrew ( for the solution.

Hope it helps..



Fix- Multiple levels of many-to-one relationship expansion aren’t supported in PowerApps

We would get this error while trying to get the value of a related entity (lookup) through a related entity (lookup) in the current record using the incorrect formula.

For e.g. here Region is a lookup in the Village, which in turn is a lookup in the Product record (ThisItem).

The solution here is to use the LookUp function




LookUp(Villages, Village = ThisItem.Village.Village).Region.Name


Search the Villages table, using the GUID of the Village, and fetch the name of the region lookup field in it.

Hope it helps..

%d bloggers like this: