{Steps by Step}Embed a Power Virtual Agents bot in Canvas App

In this blog, we will learn to embed a Power Virtual Agents bot in Canvas App.

Requirement:

Adding Power Virtual Agents chatbot into Canvas App, Power Virtual Agents bot can handle multiple conversations simultaneously, which means it can scale up to meet increased demand without requiring additional resources.

Implementation:

Firstly, we need a bot, to create a bot follow these steps.

  • Go to https://make.powerapps.com.
  • Sign into power apps.
  • Click on the “Power Platform” from the left navigation panel.
  • Select “Power Virtual Agents.”
  • You can use the old chatbot also.
  • Click on “Create“, then select “Try the unified canvas (preview).”
  • Give a title to your chatbot.
  • Click on “Create” button.

After creating a bot, we need to enable the Power Apps component framework feature.

  • Go to the Power Apps portal.
  • Click on the gear icon on top right corner and select “Admin Center.”

  • On the left pane, select “Environments, select the environment where you want to enable this feature, and then select “Settings.”
  • Expand “Product” and select “Features.”
  • Turn on “Power Apps component framework for canvas apps,” then select “Save.”

Now we need a solution that consists of “IFrame” exists.

  • IFrame will hold Canvas App and bot together.

Now create a Canvas App or open the existing one.

  • Click on the “Tree view” from the left pane.
  • Now go to the “Components” and click on three dots.
  • Select “Import components.”
  • Click on “Code.
  • Select “IFramePCF” component.
  • Click on “Import.”
  • IFramePCF is now displayed under components.

Now add a new screen where you want to put a Chat bot.

  • Click on “insert.”
  • Select “IframePCF” from the code components.

Now, Go to the “Chatbots” in Power Apps portal.

  • Select your Chatbot.
  • And select “Edit.”
  • Go to the “Setting” in the left pane.
  • Select “Channels
  • Now select “Mobile App.”
  • Under Embed code, copy the ‘src’ section only (highlighted below): 
  • Now, Go back to the Canvas App.
  • Select “IFramePCF” component from tree view.
  • And click on “Advance.”
  • Paste the URL from the bot copied in the “src.”
  • Save and publish.

Output: Chatbot is now uploaded on Canvas apps.

Hope it helps! 

Power 365ing as usual! 

Any requirements, implementation or consulting work in Power Platform or Dynamics 365 – end user, Microsoft partner or an individual? 

Problem Area – Technical, Functional, Training, Development or consulting? 

Me and my team are here to assist, please fill the following form for your business needs: Click here 

Advertisement

{Step by Step}Share record with a user using Unbound action in Power Automate

Requirement:

In this blog, we will learn how to share records from Microsoft Dataverse to a user with the help of using an Unbound action in Power Automate, In Power Automate, an unbound action is a type of custom action that is not associated with a specific entity or record in a Dynamics 365 environment. It is a standalone action that can be called from any workflow or automation.

Implementation:

  • Go to https://make.powerapps.com.
  • Sign into Power apps.
  • Click on “Flows” from the left navigation panel > “+New flow.”
  • Select “Automated cloud flow.”
  • Give a title to your flow.
  • Search for the Microsoft Dataverse trigger “When a row is added, modified, or deleted.”
  • Select the Microsoft trigger.
  • Click on “Create.”
  • Select “Added” in the Change type.
  • Select an entity, we have selected an “Accounts” entity here.
  • Select “Organization” in the scope field.
  • Click on “+New step” for adding action.
  • Search for “Perform unbound action.”
  • Select Microsoft Dataverse action “Perform an unbound action.”
  • Select “GrantAccess” in the action name field.
  • In the target field enter entitylogicalname-plurarl(recordid) or entitylogicalname-plurarl/recordid.
  • You can add the dynamic id of the entity, we have added a dynamic id.
  • PrincipalAccess includes the user or team to which access will be provided and the Access Mask for the Privilege, in JSON format.
  • Click on “+New step.”

Tips: In this blog, we gave an access to user, for giving an access to team use the code given below.

Principal access for team.

{
"Principal:"
{
"teamid":"",
"@@odata.type":"Microsoft.Dynamics.CRM.team"
},
"AccessMask":"ReadAccess"
}
  • Search for “Initialize variable.
  • Select “Initialize variable.”
  • Write “At” in the Name field.
  • Select “string” in the type field.
  • Write “@” in the Value field.
  • Click on “+New step.”
  • Search for “Compose.”
  • Select “Compose.”
  • Add PrincipalAccess JSON for sharing user.
  • Use the dynamic id of “At” instead of using “@.”

Hope it helps! 

Power 365ing as usual! 

Any requirements, implementation or consulting work in Power Platform or Dynamics 365 – end user, Microsoft partner or an individual? 

Problem Area – Technical, Functional, Training, Development or consulting? 

Me and my team are here to assist, please fill the following form for your business needs: Click here 

{Step by Step} Create a waffle sliding menu panel in the Canvas app

In this blog, we will learn how to create a waffle sliding menu in Canvas app.

Requirement:

Creating a waffle navigation menu for easy accessibility of features and navigating other screens.

Implementation:

  • Sign into Power apps.
  • Create a Canvas app.
  • Go to insert and add a timer.
  • Select the timer and go to “Advanced” in the properties pane, On start switch “false” to “VarTimer”.
  • Change the duration of the timer from “6000” to “150”.
  • Add a “Waffle menu” icon.
  • And “OnSelect” of icon properties. UpdateContext({VarTimer:false});UpdateContext({VarWaffle:!VarWaffle,VarTimer:true})
  • This will start and stop the timer with the waffle menu.
  • Let’s create a flyout panel.
  • Add a rectangle and place it on the waffle menu.
  • On the “X” properties of waffle menu=If(VarWaffle,-115,-115+115*(WaffleTimer.Value/WaffleTimer.Duration))
  • Here we can see that the panel is on the left side of the screen.
  • Add one more waffle and on the “OnSelect”= UpdateContext({VarTimer:false});UpdateContext({VarWaffle:!VarWaffle,VarTimer:true})
  • And on the “X” property of the waffle menu paste the same value of the flyout rectangle’s “x” value.
  • Add buttons or icons in the flyout rectangle with the same “X” value as the flyout rectangle.
    • If(VarWaffle,-115,-115+115*(WaffleTimer.Value/WaffleTimer.Duration))
  • Save and publish.

Output:

Hope it helps! 

Power 365ing as usual! 

Any requirements, implementation or consulting work in Power Platform or Dynamics 365 – end user, Microsoft partner or an individual? 

Problem Area – Technical, Functional, Training, Development or consulting? 

Me and my team are here to assist, please fill the following form for your business needs: Click here 

{Step by step}Searchable drop-down in Canvas app

In this blog, we will learn about “Combo box” feature in Canvas app.

Requirement: Creating a search option with the drop-down, for searching items in the list easily just by typing and searching rather than scrolling.

Link to Microsoft docs: shorturl.at/epvNW

Solution:

  • Open Canvas app.
  • Click on insert and select the combo box.
  • Click on combo box and go to the “Advanced” option in the properties pane.
  • Search “ IsSearchable” and switch it to “ true”.
  • Here we are using default data of “Combo box”.
  • Search “SelectMultiple” and switch it to “false”.
  • Search “InputTextPlaceholder” and define what you want to display in the drop-down.
  • Save and publish.

Outcome:

Hope it helps!  

Power 365ing as usual!  

Any problem in Power Platform or Dynamics 365 – end user, Microsoft partner or an individual?  

Problem Area – Technical, Functional, Training, Development, or consulting?  

Me and my team are here to assist, please fill the following form for your business needs: Click here  

{Step by Step} Apply Power-FX Preview Formula Feature 

In this blog, we will learn about a new Power FX preview feature.   

Business requirement: To find difference between two dates by using “Formula” Data type. 

Follow this link to see “Formula” option as a data type.  

Link. (https://make.preview.powerapps.com/) 

After using this link, select the table where the “formula” data type is to be used. 

Here, we have created a table named as “Custom Table”. 

Now, we will add new column named as “Total Days” inside the table and select the data type as “Formula.” 

Also, we must already have created two date time columns “start date” & “end date.” 

  • Formula for Date Difference: 

DateDiff(new_startdate,new_enddate) 

Now, we must add this formula in “Total Days” field inside Formula section.

After that, we must Add columns to main form. And click on save to publish the outcome. 

Let us see what will happen! 

Hope it helps!  

Power 365ing as usual!  

Any problem in Power Platform or Dynamics 365 – end user, Microsoft partner or an individual?  

Problem Area – Technical, Functional, Training, Development, or consulting?  

Me and my team are here to assist, please fill the following form for your business needs: Click here  

About the Author:  

{Quick Tip}Enabling custom plugin error messages to the PowerApps Portal page in D365

In this blog, we will learn about How to throw a custom error message in the PowerApps Portal page in D365.  

Sometimes when we are working on the PowerApps Portal, and we want to show some custom error message by using a Plugin based on some business logic, we will get a generic error message which is not useful to the end user that will say “An unknown failure has occurred. Error ID …” as shown in the fig. Given below : 

So, we will display the custom error message error with the help of the site setting in PowerApps portal. The steps are as follows: 

  • Firstly, Go to Apps > Portal Management  
  • Go to Site settings > New 

So, let us see what will do. 

Name - Site/EnableCustomPluginError 
Website – Whatever you have like Partner Portal, Customer Self-Service, etc… 
Value – true 

  • Then, Save & close.  

And go to portal > Sync Configuration and click on Browse Website. 

Let us see what happens! 

So, you will see the custom error message on the screen. 

Hope it helps!   

Power 365ing as usual!   

Any problem in Power Platform or Dynamics 365 – end user, Microsoft partner, or an individual?   

Problem Area – Technical, Functional, Training, Development, or consulting?   

I and my team are here to assist, please fill out the following form for your business needs: Click here   

About the Author:   

{Step by Step} Apply Patch Function from command using Power FX via new command editor

In continuation of my previous articles where we were exploring how to use the new Command designer, today we will learn how to apply a more complicated Patch function via Power Fx Command.

You can refer the previous parts as listed below:

Part 1: How to create a button:

Part 2: How to apply a Power FX command using Command

Part 3:Apply Show Hide rules using Power FX command

In this blog, we will learn about the Patch function of Power FX in PowerApps, and we will use it in button click using the brand-new command editor!

Today’s requirement is that the account name should be updated at the click of a button.

To implement this requirement, first we need create a command button for which you should refer to Part 1 mentioned above.

We have created a button named as “Patch.”

And, we have used this formula to implement our requirements and added the formula for the notification:

Patch(Accounts, Self.Selected.Item, {‘Account Name’: “Patched: ” & Self.Selected.Item.’Account Name’});Notify(“Acount name is Upadated successfully”)

Let us test this button now! 

As you can see the account name is updated on the click of the Patch button.

Hope it helps! 

Power 365ing as usual! 

Any requirements, implementation or consulting work in Power Platform or Dynamics 365 – end user, Microsoft partner or an individual? 

Problem Area – Technical, Functional, Training, Development or consulting? 

Me and my team are here to assist, please fill the following form for your business needs: Click here 

About the Author: 

{Step by Step} Add Show/Hide visibility rule using Power Fx to a Command button using new Command designer

In continuation of my previous articles where we were exploring how to use the new Command designer, today we will learn how to apply show and hide rule using Power Fx in the new command designer.

Part 1: How to create a button:

{Step by Step}Create Command button in Power Apps using command designer

Part 2: How to apply a Power FX command using Command designer: https://dynamicsofdynamicscrm.com/2022/08/04/step-by-stepadd-power-fx-commands-on-a-command-button-using-command-designer/

In last article we had already created a button named as “Entity Details.”

Now let us apply show and hide rule to the button!

Formula

Select the button “Entity Details”, click On Visible property and apply below formulae:          If(CountRows(Self.Selected.AllItems) > 0,true , false)

Based on this formulae, if at least one row of data is selected, button will be visible. Else, it will be invisible.

Please refer screenshot below:

As seen in below screenshot, command button is visible only when at least one contact is selected:

Tip: Sometimes the change on button does not reflect instantaneously, so you might need to refresh the page two to three times!

Now let us see the button visibility when no contact is selected:

Hope it helps!

Power 365ing as usual!

Any problem in Power Platform or Dynamics 365 – end user, Microsoft partner or an individual?

Problem Area – Technical, Functional, Training, Development or consulting?

Me and my team are here to assist, please fill the following form for your business needs: Click here

About the Author:

{Step by Step}Add Power Fx Commands on a command button using command designer

In the last post we learnt how to add a command button using command designer: https://dynamicsofdynamicscrm.com/2022/07/27/step-by-stepcreate-command-button-in-power-apps-using-command-designer/

In this post, we will explore various Power FX commands we can add using new command designer:

We will cover the formulas “Navigate”,” URL” and “Notify”.

First go to the site map for Account table and click in the three dots ,click on edit command bar. Thereafter select the Main grid.

Three buttons are created as per reference in my last blog.

On click of “Navigate Active Record” button, we will navigate to “My Active Accounts” view

  • Formula for Navigate.

Navigate(‘Accounts (Views)’.’My Active Accounts’)

  • Result:

Now let us try to click on Navigate Active Records on Inactive Accounts view:

You can see that on click of the button we have navigated to “My Active Accounts” view:

Formula for URL:

Launch(“https://dynamicsofdynamicscrm.com/”);

Formula for Notify:

On click of Notification command button, we will try out Notify command:

Notify(“YouSelected”&Self.Selected.Item.’AccountName’,If(CountRows(Self.Selected.AllItems) > 0,true,false))

  • Outcome:

There is a show hide formulae also applied on this button(about which we will learn in my next article). The button will only be visible on selection of particular record:

On selecting a single account named “A.Datum dd” and clicking on the “Notification” button, you can see above that the name of the record is showing in the notification section.

Hope it helps!

Power 365ing as usual!

Any problem in Power Platform or Dynamics 365 – end user, Microsoft partner or an individual?

Problem Area – Technical, Functional, Training, Development or consulting?

Me and my team are here to assist, please fill the following form for your business needs: Click here

About the Author:

{Step by Step}Create Command button in Power Apps using command designer

In today’s blog we will learn how to make command button using command designer. I am taking out of box entity Contact as an example in which we would add a command button. 

The objective is to add a command button to the marked main grid ribbon area as in the below snapshot. 

So, let’s go ahead and create the command button. 

Add Command button using Edit in Preview method of Power Apps:

Open any model driven app, click 3 dots to choose Edit in Preview and choose entity for which you want to add button. 

Let us use Sales Hub app as an example:

After that you will get a new interface in which you have to select the three dots of the entity where the command button you to added Click on edit Command bar:

Choose where you want to add button.

You can choose from the Main grid, Main form, Sub-grid and Associated view to add buttons. 

Thereafter, click on new button then click on command:

A command button has been created, now let’s edit its label.And can also select the visibility of the button  

Click Save and Publish.

Finally now you can see that a command button has been created in the marked box, whose label text is “Entity Details”. 

Hope it helps!

Power 365ing as usual!

Any problem in Power Platform or Dynamics 365 – end user, Microsoft partner or an individual?

Problem Area – Technical, Functional, Training, Development or consulting?

Me and my team are here to assist, please fill the following form for your business needs: Click here

About the Author: