Everything You Need to Know About Embedded Canvas Apps

Hello Readers

Hope you are all well!

It’s been a while since I last wrote, I got super busy with my community events and the new work life.

I will try to be as regular as possible on my posts.

Today, I am sharing everything I know about using an embedded canvas app in Dynamics 365 and Model Driven Apps; this will be more of a guide.

How many apps can I embed on a form?

Three canvas apps at a time, per form on web and one for Phone or Tablet.

Is there a workaround to use more than three apps on the web for?

Yes, use a webresource with your app URL and adjust the height and width. You might need to pass a parameter in your app depending on what the app is for. (Not the best result but a workaround)

What do I need to consider if it’s the first canvas app of my organisation?

If this is your first app, you might want to cross check security roles of users who’re going to use this app within Dynamics 365 as you need to provide additional privileges, assuming you’ve been using Dynamics 365 already. The privilege is called ‘Canvas App’, minimum read privileges will be required.

Is there something specific I would need to communicate to the users on the launch day?

  • Users will see a sign in screen first time and must sign in.
  • Users will need allow access.
  • Session will timeout in case of inactivity and users will be required to sign in again.

How to share an embedded canvas app?

In the maker portal, click the ellipses to share the app. You can share the app to everyone or specific users. The easiest way to share with a group of users (if you don’t have a security group) is export users to excel and transpose to a row with comma separated aliases. This is not the fastest way if you want to share with a small number of users like 3-5 but 50-100.

Special control ModelDrivenFormIntegration and related actions

NameDescriptionExample
ItemAccess the record on which you embed the appModelDrivenFormIntegration.Item.InvoiceID
SaveFormSaves the record on which you embed the appModelDrivenFormIntegration.SaveForm()
OpenQuickCreateFormOpens a quick create form of the table specified (default form in case you have more than one quick createModelDrivenFormIntegration.OpenQuickCreateForm(Contacts)
RefreshFormRefreshes the record on which you embed the appModelDrivenFormIntegration.RefreshForm(true)
ModelDrivenFormIntegration.RefreshForm(false)
**true or false is for the pop up message of unsaved changes on the model driven form
NavigateToViewNavigates user to a view of the specified tableModelDrivenFormIntegration.NavigateToView(Accounts, ‘Active Accounts’)
NavigateToMainFormNavigates user to a form of the specified tableModelDrivenFormIntegration.NavigateToMainForm(Contacts, ‘Unified Interface Contact Form’, ‘GUID’)

**Opening ‘Modal Dialog’ form via ModelDrivenFormIntegration is not possible at this stage.

Enable or Disable an embedded canvas app

On the field properties control tab👇

Why can’t I see my embedded canvas app?

Make sure you’ve the following things in place:

  • You’ve the right license.
  • You’ve the right privilege in your security role.
  • You’ve enabled third party cookies and local data.

I am a system administrator but cannot see my embedded canvas app

It will not appear until you first save the form meaning if the record is not created then you will only see a blank space.

How can I get related data in embedded canvas app?

On most forms in Dynamics 365 and Model Driven apps you will at least have one look up field. And to be able to get data out of it, you cannot use the special control directly i.e. ModelDrivenFormIntegration.Item.PriceLists.Name would not given you any result but error. Instead use, LookUp(Invoices, Invoice = ModelDrivenFormIntegration.Invoice).’PriceList’.’Name’

Quick Tip

Try and use a required field to link/embed the app to. If not, try auto-populating default data via a business rule or JS because if your field is blank then your app will not refresh in context of any data changes on the form where the canvas app is embedded.

That’s all I have to share. I will try and keep adding to the list. If I have missed on something, please comment and I will add it to the list.

Hope it helps!

Columns missing data after upgrading from web client to UCI

Hello Readers

This one is to save you a lot of time. I am unsure, how many people are still to upgrade but sharing anyway.

Issue: When you upgrade from web client to UCI, some columns in the views will show as blank.

Reason: I couldn’t find any reason and then Microsoft came to rescue. This might occur because the missing data column is not in the FetchXML of the view. UCI depends on the view metadata to retrieve data from server. In web client this was different.

Solution: Remove column and add it back, save and publish. And the data will start appearing again. Make sure to do this in dev/test/sandbox environment first and then move the solution to production.

Hope that helps!

Make your bots (PVA) aware of the Power Apps Portal Logged In User

Hello Everyone

Hope you’re all doing good.

In this video we are talking about how to make your bot smart enough so the bot is aware of Portal User’s name. And skip the question of asking name, email etc. completely because the user is already logged in to the portal.

Video here:

Hope it helps!

See you in the next one.

Show/Hide Bots (PVA) In Users Preferred Language on Power Apps Portals

Hi Everyone

Hope you’re all doing good.

In this blog we are talking about how to show/hide a bot of users preferred language on Power Apps Portals.

Power Apps Portals provides a field on user profile called ‘Preferred Language’. That’s the only way you know what is your users preferred language. Instead of using the default ‘Preferred Language’, I created a text field on user profile also called ‘Preferred Language’ (different schema name though)

Now in the video I am using Preferred Language as a filter to show either english or spanish bot based on what is the value in preferred language field of user’s profile. if the field is blank, we can show probably english or any other language which is mostly spoken in your region.

Video here:

Hope it helps!

See you in the next one.

Three ways of adding your chatbot (PVA) to Power Apps Portals

Hi Everyone

Hope you all are doing good!

In this video I am talking about the following three methods of adding your PVA on Power Apps Portals. All super easy.

  1. Embed HTML Code
  2. Add an Iframe
  3. Customised canvas, index.html (https://docs.microsoft.com/en-us/power-virtual-agents/customize-default-canvas?WT.mc_id=BA-MVP-5003605 )

Watch the video here:

Hope it helps!

See you in the next one!

Power Virtual Agents-Bot Variables, Multi-Language and working in a Solution

Hi Everyone

In this video, I am talking about three new features that were released between April-May 2020.

  • Bot Variables/Global Variables
  • Support for additional languages
  • Adding your chatbot to a Power Apps solution

Bot Variables– The new variables allows you to select one of the two options; local or bot. if use select local then you can use the variable only in that specific topic while if you select bot then you can use the variable across topics in your bot. Moreover, you can now use variables in external sources like websites.

Support for Additional Language– You can now make your bot in multiple languages, providing you a global reach. Along with English you now 15 more languages in preview and should be available generally soon. There are three more languages which are in experimental state, namely Hindi, Korean and Polish.

Working in a solution– You can now add your chatbots to a solution in Power Apps makers portal. All the components are added within a solution. The solution can then be exported or imported depending on your needs.

Video here:

Hope it helps!

See you in the next one.

Why use emojis in Power Virtual Agents?

Hello Everyone

Hope everyone is keeping safe!

In this blog we are going to talk about emojis in Power Virtual Agents. We will also touch upon GIFs and images but mostly Emojis. First of all, if you were not aware that you can use emojis in PVA, I am telling you can and that too #thecodeway. Watch the video to see it working.

If your question is why am I talking about something which is available Out of the box and is a no brainer; my answer would be:

  • I have not seen emojis being used yet in PVAs (Silly side of me)
  • Main reason: User Experience (UX) is the reason I am writing this blog.
  • Add some emotional intelligence to your PVA
  • It saves your canvas in your PVA.

Emojis are used by more than 3 billion people (and growing) which makes it the most spoken language in the world. One picture is worth ten thousand words.

For good UX your bot needs to react to different types of messages not just text.Knowing that PVA is still new in the market and is being continuously updated, there might be some emojis which you can’t use (No, I haven’t tested all 20,000 of them 😀)

Using emojis can be a great way of defining your chatbots personality and it can make the conversation casual increasing the engagement rate.

In terms of using a GIF or Image as your PVAs response, use the following and it will be shown to the user. Yes, I am also waiting for the adaptive cards #thenocodeway.

![](public URL of your GIF or Image)

Let’s watch the video, if this interests you. Following is covered in the video:

  • Creating topics with Emojis
  • Creating entities with Emojis
  • Sending response with Emojis
  • Sending response with GIF and Image

Video here:

Hope it helps!

Thanks!

Agent, Power Virtual Agent – Episode 7: Customer Identification Process In PVA

Hello Everyone

Hope you’re all keeping safe. For information on how to keep yourself safe from COVID-19 visit https://www.who.int/emergencies/diseases/novel-coronavirus-2019/advice-for-public

This is the last episode of Agent, Power Virtual Agent series. Playlist here

This episode of Power Virtual Agents (PVA) is about how to identify and verify your customers in PVA. In Episode 5 we looked at authenticating internal users but what if we want to verify customers before providing them in any information.

We are going to achieve this with the help of a Power Automate Flow and PVA variables.

Video here:

Hope it helps!

Stay Safe.

Agent, Power Virtual Agent – Episode 6: Configuring Channels (Custom Website & Microsoft Teams)

Hello Everyone

Hope you’re all keeping safe. For information on how to keep yourself safe from COVID-19 visit https://www.who.int/emergencies/diseases/novel-coronavirus-2019/advice-for-public

This episode of Power Virtual Agents (PVA) is about how to configure channels in your PVA.

This is #thenocodeway to leverage the power platform. Following steps are required:

Custom Website

  • Go to Channels –Custom Wesbite
  • Copy embed code
  • Go to your website and paste it on the desired page

Microsoft Teams

  • Go to Channels
    • Teams
    • Generate App ID by clicking ‘add’
  • Go to admin.teams.Microsoft.com
    • Teams apps
    • Permission policies
    • Third party apps- allow
  • Go to Teams app-Create a channel if you need to
  • Go to app studio (https://aka.ms/InstallTeamsAppStudio _Install App Studio)
    • Go to manifest editor and click create a new app
    • Enter app details
    • Then go to capabilities–bots
    • Set up an existing bot uEnter App ID generated by PVA
    • Go to finish and test your bot (Either download and upload file or just install and add)

Video here:

Hope it helps!

Stay safe!

Agent, Power Virtual Agent – Episode 5: Step by Step Authentication

Hello Everyone

Hope you’re all keeping safe. For information on how to keep yourself safe from COVID-19 visit https://www.who.int/emergencies/diseases/novel-coronavirus-2019/advice-for-public

This episode of Power Virtual Agents (PVA) is about how to authenticate users in your PVA.

This is #thenocodeway to leverage the power platform. Following steps are required:

  • Go to Manage and click ‘Authentication’
  • Pre-filled and optional fields on the authentication form:
    • Service Provider
    • Scopes
  • Copy information from docs.microsoft.com for the following fields:
    • Authorisation URL query string template – ?client_id={ClientId}&response_type=code&redirect_uri={RedirectUrl}&scope={Scopes}&state={State}
    • Token URL query string template “?”
    • Refresh URL query string template “?”
    • Refresh body template -refresh_token={RefreshToken}&redirect_uri={RedirectUrl}&grant_type=refresh_token&client_id={ClientId}&client_secret={ClientSecret}
    • Scope list delimiter “,”
    • Token body template -code={Code}&grant_type=authorization_code&redirect_uri={RedirectUrl}&client_id={ClientId}&client_secret={ClientSecret}
  • Azure portal– App registration
  • Register App and get your Client ID
  • Remaining fields for authorisation configuration
    • Authorisation URL template- Overview>>Endpoints>>OAuth2.0 authorisation endpoint 2.0 (copy)
    • Token URL template-Overview>>Endpoints>>OAuth2.0 token endpoint 2.0 (copy)
    • Refresh URL template- same as token URL template
    • Scope- Your DB URL/user_impersonation

Video here:

Hope it helps!

Stay safe!