cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MattTaylor
Helper II
Helper II

Scroll Bars for Embedded Canvas App on the Model-Driven App Form

Hi folks,

 

I wonder if anyone can help. I've got an canvas app embedded on a model-driven app form and even though I've played with settings on the App I am getting a huge section of white-space below the app, which results in a scroll bar - this is not on the app itself but the section on the model-driven app that the canvas app is embedded: 

scn_gsscroll.png

 

The app itself is set to 1200 x 400 and I've played with the resize settings in the app settings and neither option removes the scroll bar. The app is embedded in a single-column section on the main form. 

 

Any advice gratefully appreciated.

 

Kind regards,

Matt

17 REPLIES 17
Chrisa_uk20
Regular Visitor

Has anyone found a resolution for this? I have the same issue. My app is 768 height, and all the controls fit on however when you run it in a Dynamics form it is 3998 high :-(.

 

Like the original poster I have tried all combinations of size and scale.

Hi @Chrisa_uk20 

 

One thing I have noticed is that if you make a lot of changes to an embedded  canvas app, the app "window" increases in size, not the actual app canvas. To test this out, and I know it's not ideal, embed another canvas app by removing the field that currently associates the canvas app to the model-driven form, and see if you still get the border. If you don't, copy all controls from your old app to this app and see if the scroll bar still stays away. 

 

Let me know the outcome of this. It has helped me get rid of the scroll bar on numerous occasions. 

 

---
If you like this reply, please give kudos (Thumbs Up). And if this solves your problem, please mark this reply as a solution by selecting Accept as Solution. This makes it easier for others to find answers to similar questions. 

 

Thanks!

Hardit Bhatia

Microsoft Business Applications MVP

Microsoft Certified Trainer MCT

Blog | Twitter | LinkedIn | Facebook | YouTube  |  Email

not_a_thing
Helper I
Helper I

Have exactly the same problem, unfortunately

@Chrisa_uk20and @MattTaylor , have you been able to resolve the issue?
I don't want to put the app in the iFrame, since it will damage the width-scalability

MattTaylor
Helper II
Helper II

@not_a_thing, I've had no luck with this - I've essentially just given up on it; I have two Apps embedded on two different forms. They are both the same size, they have the same settings and are embedded the same way. One works (i.e. no scrolling) and one doesn't...

you gotta be kidding...
well, I'll try to build the app from scratch and see if it helps.. Thanks for the swift reply

It's crazy - I am working on them at the moment and will check to see whether the field type makes any difference (the one you bind on the form for the embedded App. I'll post back if it works! 

 

OK, our client has been generous and let me have the time needed to find out about this.

First thing first, I found this article:

Embedded canvas app guidelines and known issues

There, there are basically 2 things that can screw it up:


  • The Scale to fit option isn’t enabled with the canvas app.
  • The App Name property value is missing or is incorrectly defined in the embedded canvas app control. This might occur when the model-driven app and canvas app have been imported as a solution into another Dataverse environment.

So I narrowed it down to App Name, as Scale to Fit seems to have no effect in my case - it definitely can't fix the issue by just turning it on when you already have the white space below the app.

After creating a bunch of test apps, moving them around, trying on different screens, I have come to this conclusion:
 
  1. You can only create canvas apps on embedding to the model-driven form. Creating it first, and copy-pasting the ID in the model-driven form will work, but! it will drag some bugs in the process - like the white space below.
    The reason for this, you'll need to have the auto-generated app name in the app name field. Otherwise, this will always produce white space below the app
    embed-canvas-field-properties
    Several guides state that you can just copy both App name and App ID "exactly how they appear on the screen", but you can observe, that even on the example screen above from MS (Add an embedded canvas app), the name is not exactly the app's name, but prefix+appname+suffix ("contoso" and "c2ae6" in this example). Prefix is just the same as in solution, but I have not been able to see any connection between the suffix and my current environment or solution.
  2. Resizing the app only works while Scale to Fit is turned on (meaning app not scaling to fit, not_a_thing_2-1624355178597.png to Microsoft). If your app needs to fit to the column width, (thus the need to turn the option for Scale to Fit off), then you need to first enable Scale to Fit, adjust height/width in the settings, save+publish, turn off Scale to Fit, save+publish
  3. Having dynamic FormScreen Height is just a roulette. This is confusing, why setting height to Max(App.Height, App.MinScreenHeight) will sometimes destroy the rendering, an sometimes it will not.

 

So what I did was to create a new app inside the form, set the right size from the very start in advanced settings, leave the Scale to Fit option on, save (it will autopublish).

WAIT until the App name field will autogenerate in the model-driven form. Save and publish the form

Go back to the app, adjust both App.MinScreenHeight and App. MinScreenWidth to the smallest values desired, adjust all of the Screens Height and Width to the same constant values that you provided for the app size (in the advanced settings), save and publish.

Then I spent half an hour copying my old app to the new; many things will copy-paste, but the the absolute positions of the controls were wrecked. Media had to be re-imported.

Save and publish.

At this time, the white space below will disappear, but the scrollbars will remain, when you switch to a smaller screen.

This is when you change the Screen Height and Witdh back to default Max(App.Height, App.MinScreenHeight) and Max(App.Width, App.MinScreenWidth) and turn Scale to Fit off.

This is my result:

not_a_thing_3-1624356299116.png
from the original Embedded canvas app on a model-dribven form has hu... - Power Platform Community and I haven't been so happy in a week 🙂

Excellent work! I'll test this on our environments tomorrow - I have two identically sized Apps on different forms and one works and one doesn't (all settings are identical) 

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (1,143)