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 – Configure Voicemail Workstream and Queue – Dynamics 365 Customer Service

When we configure the Voice demo, we can see 2 workstreams and queues created for Voicemail one for individuals other for voicemail of type group.

The Default Group Voicemail Workstream has the following intake rule defined.

And following Route to Queue Rule

Configuring Voicemail –

Similarly, Default Individual Voicemail Workstream has the following intake rule

And Route to Queue rule

Now say we want the voicemail of an advanced queue (type – voice) to be routed to its corresponding advanced queue (type – record) instead of the Default Group Voicemail Queue.

Say we have the below Advanced Queue of type Voice used in the Voice Workstream– 


And the below Advanced Queue – My Sample Voice Mail Queue

Now let us define the Workstream that will route the voicemail to that queue.

Select Type as Record and Record Type as Voicemail.

The intake rule checks for the Queue record in the related entity of voice mail – Missed Conversation (Conversation)

So basically any conversation or voicemail generated because of a call to My Sample Voice Queue / Workstream will be routed to its corresponding Voice Mail Queue.

Overflow handling

And the intake rule of that workstream to route to the Voicemail Queue created earlier.

Hope it helps..


How to – Enable Desktop notifications when the app is in the background – Dynamics 365 Customer Service (Omnichannel – Voice)

Below is how the notification appears to the agents for the incoming conversation. In case the app is in the background the agent might miss the notification. To avoid this scenario we can enable Desktop notifications.




Navigate to Agent Experience >> Workspaces >> Notification Templates (Manage) in the Customer Service Admin center

Here we can see the default template – authenticated and unauthenticated for the incoming voicemail. We cannot update these out-of-the-box templates, however, we can refer to these existing templates to create a new template.

Let us open the existing incoming authenticated template.

The Voice call – incoming authenticated – default :-

Let us create a new template, referring to the existing template, where we will set the Show Desktop Notifications = When the app is in the background.

Notice we can specify other values such as notification timeout, auto assign work items, show reject button as well as notification fields.

Below is our new notification template.

With the template created, navigate to the workstream to which we want to apply this template. In the Agent notification template, specify the custom notification template for the Incoming Authenticated.

Also, enable Notifications for the app in the browser from Site Settings.

Here we can see the Desktop notification for the agent on the incoming call.

Learn more about it –

To enable Sound Notification –

Hope it helps..



Dynamics 365 – Different Ways of Showing Form Level Error Messages – setFormNotification | setIsValid

setIsValid() function for Validation

Crm Minds

Form notifications are useful when you want to prevent the user saving the form if the form fields do not meet the conditions.

Say you have 2 date fields called “Start Date” and “End Date”. You want the records can only be saved if the “End Date” is bigger than the “Start Date”.

You have 2 different options to show a form notification here:

You can use setFormNotification() function when validation fails and use clearFormNotification() when validation pass. You need to specify message, level and uniqueId parameters.

Or you can use setIsValid() function. You call it only once and pass it validation result with error message. It is definitely less code lines 😎

This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters

View original post 192 more words

Fixed – Automated messages not working in Voice Channel – Dynamics 365 Customer Service

Recently we were facing an issue with a customized automated message that we had configured for one of our voice channels. The message was not getting played and in fact, the default message was also not getting played for our customer.

After some testing, we realized it was because the message had a “&” character in it.

Removing the “&” resolved the issue for us.

Hope it helps..


How to – Set Default value for the combo box in Canvas Apps (Dataverse)

Suppose we have the following Combo Box named Status bind to one of the choice fields of Dataverse.

Items = Asset Status option set field of table Product.

Now if we want Available to be the default selected value for it, we can use the DefaultSelectedItems property of the combo box.

DefaultSelectedItems = Filter(Choices(Products[@’Asset Status’]), Value = ‘Asset Status’.Available)

Also if we want to set the value of the Villages combo box based on the value selected in the Region combo box. The region is a lookup field in the Villages table.

We can update the Items property of the Villages combo box from

Villages (Data Source)


If(IsBlank(comboRegion.Selected),Villages, Filter(Villages, Region.Region = comboRegion.Selected.Region))

Hope it helps..

%d bloggers like this: