cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AndrewB
Frequent Visitor

Can I include Screen (Data type: Control) in a collection?

**Describe the bug**
I would like to populate a collection in the App On Start  that includes a column for Screen (Data type: Control).   This collection would be passed to a component with a gallery control for navigation.    This worked until a few weeks ago.  Now it seems that PowerApps Internal Error is being thrown when trying to add a Screen object to a collection.

 

AndrewB_0-1620234095895.png

 

 

Any thoughts?

 

**To Reproduce**
Steps to reproduce the behavior:
1. Create an instance of the Crisis Communication App found here Crisis communication sample app - Power Apps | Microsoft Docs Create a collection in The App OnStart for a Canvas app

2. Go to 'The App OnStart.'
3. Right click App 'Choose OnStart'
4. Scroll down to 'to the colNav collection, double click and view the columns'
5. See error

**Expected behavior**
You would expect to see values in the following columns:
Screen
Image

 

If you remove the Screen (//Screen: 'Request Screen') column from being populated on App OnStart, then the Images property will reappear on the home page. If you try to add the Screen column back to the colNav collection it will break.

 

From what I can tell, the Screen (Data type: Control) is causing an issue when being added to a collection

 

**Screenshots**

For all Collect(colNav) comment out all entries starting with Screen, then the collection works for images

AndrewB_4-1620233456697.png

 


If I put the Screen column back in the collection then I get the error on the gallery I'm binding to again

AndrewB_1-1620233361344.png

 

 

If you click on the colNav collection passed to the Home Screen, you'll see that it's not being populated, even though it populated in the App OnStart

If I click on the Items property of the home menu you get the error that the gallery is expecting a different record structure

AndrewB_5-1620233503295.png

 


**Interface(please complete the following information):**
- Browser Edge 90.0.818.49 (Official build)(64bit)


**Additional context**
Add any other context about the problem here.

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@AndrewB 

Well, one issue is that you have your Items property set to colNav.

You have the Table definition commented out in the Items property...it should be that, not a dependency on the underlying app.  Components are meant to be autonomous and removable and reusable in other apps.  If you component is designed with a dependency on the underlying app...well, it's not a component and more.

 

But still, the collection is overkill for what you want.  You can work all of this from a basic variable.  You just need to filter it by what you want based on the admin aspects of the other app.  This all works fine.  I know what you are doing with it - I do that often, just no need for a collection.  Not that collections are bad, they just have a place and this is not necessarily one of them.  Plus they are entirely overused!!

 

Back to the first paragraph, components have issues!!!  I will just restate that they have issues with tables with complex types in them.  Graphics and control objects sometimes will cause this.

Ex..   Recently did one with what I thought was a simple table schema.  Now that schema had some complex columns in it (tables in the column).  Not a problem in the app, but in the component, even then the simple columns were screwed up.   If I supplied a record with, for example and in addition to the other columns - some complex, a column called Col1 with a Value in a record of "Column1" and another called Col2 with a value of "Column 2".  In the component, if I referenced Col1 it would show "Column 2" and if I referenced Col2 it was "Column 1".  Drove me batty!!  After I really nailed down the schema on the component property and a series of save, exits and re-opens, it started to work as expected - didn't feel comfortable about how long it would work and how good I felt about it in production...but, knock on wood, it is still working fine.

 

So anyway...get your App dependency out of your component to start with and keep the above point in mind.  If no joy still, then we need to look at more about how you are building and using that collection.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

7 REPLIES 7
RandyHayes
Super User
Super User

@AndrewB '

This has actually been an issue with components for a long time.  It's not just the control being adding, this also happens to records and tables in general getting "walked over" by values that should not be there.  I believe there is a major issue with the components when it comes to being able to work with the tables/records properly for complex columns.

 

BUT...it can be worked around.

So the next question would be - why are you using a collection for this?  

 

It seems as though the records you're supplying are not the same schema if it is giving the error you have.

How is the Items property of your component defined?

 

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Randy,

 

Thanks for your quick reply.   One of the reasons I am using a collection is based on app settings (yes/no) in a separate admin app, I can evaluate those choices and build a simple collection containing the navigation and icons for the home page.

 

I'm open to taking another approach.

 

If I roll the application back to an earlier version it will start working again, however that promoted version will eventually break without any changes if I open it for editing a few days later. 

 

Some history here, I've been working in this app off and on for the last few months without touching the collection and didn't have any issues.   It seems within the last two weeks that the collection doesn't like the Screen column. 

 

The reason I say that, is if I comment out that column, the collection is populated and passed successfully to the component.

 

If I'm in App On Start, the collection is populate, if switch to the home screen, gallery component, the collection is empty, states there is an error in your formula.

 

App On Start

AndrewB_0-1620243097428.png

Home Menu Gallery

AndrewB_1-1620243126882.png

 

 

RandyHayes
Super User
Super User

@AndrewB 

Well, one issue is that you have your Items property set to colNav.

You have the Table definition commented out in the Items property...it should be that, not a dependency on the underlying app.  Components are meant to be autonomous and removable and reusable in other apps.  If you component is designed with a dependency on the underlying app...well, it's not a component and more.

 

But still, the collection is overkill for what you want.  You can work all of this from a basic variable.  You just need to filter it by what you want based on the admin aspects of the other app.  This all works fine.  I know what you are doing with it - I do that often, just no need for a collection.  Not that collections are bad, they just have a place and this is not necessarily one of them.  Plus they are entirely overused!!

 

Back to the first paragraph, components have issues!!!  I will just restate that they have issues with tables with complex types in them.  Graphics and control objects sometimes will cause this.

Ex..   Recently did one with what I thought was a simple table schema.  Now that schema had some complex columns in it (tables in the column).  Not a problem in the app, but in the component, even then the simple columns were screwed up.   If I supplied a record with, for example and in addition to the other columns - some complex, a column called Col1 with a Value in a record of "Column1" and another called Col2 with a value of "Column 2".  In the component, if I referenced Col1 it would show "Column 2" and if I referenced Col2 it was "Column 1".  Drove me batty!!  After I really nailed down the schema on the component property and a series of save, exits and re-opens, it started to work as expected - didn't feel comfortable about how long it would work and how good I felt about it in production...but, knock on wood, it is still working fine.

 

So anyway...get your App dependency out of your component to start with and keep the above point in mind.  If no joy still, then we need to look at more about how you are building and using that collection.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Randy,

 

Thanks for your help.   You were right about the items property.   First of all, they named the component property Items...   however,  I took a step back and followed your advice and corrected the properties on all the components that referenced the collection variable with the correct Table definition instead.  I then set property on all the galleries inside the component to the component property for Items.   

 

In this case, under the Screens tab,  if my component was called HomeMenu_1, with a custom property called Items, I set that property to Sort(colNav,Id);

 

AndrewB_0-1620315454599.png

 

Then, in the components tab, I set the Items property for the HomeMenu component to the table definition

 

AndrewB_1-1620315608992.png

 

Then on the actual gallery control inside the component, I set it's Items property to HomeMenu.Items.

 

I have no idea how this even worked previously.   

 

Another key item you pointed out that I'm aware of now, is evaluating collections in the UI.  If you are using complex types, then they won't be visible when evaluating the variable.  I thought this was the original issue, but it's more of a rookie mistake not being familiar with PowerApps.

 

I'm still new, so I'm not familiar with how I would do this from a basic variable.  Are you talking about a record type variable?    Any references to documentation would be helpful.

 

Thanks for taking the time to evaluate my issue and for providing the right guidance to fix it!

 

Sincerely,

Andrew

 

RandyHayes
Super User
Super User

@AndrewB 

Sounds like things are progressing in a positive way!!

 

So here is the thing about collections, variables and datasources....they are all the same thing!!  The distinctions are this:

- A DataSource is a table of records.  It also has built into it the ability to "communicate" with the session table in the cloud that contains the real data.  It will automatically sync the app datasource table and the cloud session table.

- A collection is a table of records.  The only thing a collection brings to the table is the ability to add or remove rows easily.

- A variable is anything you want it to be...a simple boolean, text, number, etc. or a complete record, or a complete table of records.  It does not have the ability to directly add or remove rows.

 

So, a DataSource has a lot of overhead to it.  It has all of the data sync aspects that is pretty heavy on the app (but necessary)

A collection is a table with the overhead of the ability to add or remove rows.  It is more heavy weight on your app to have those when not needed.

A variable has no overhead to it and can be anything.

 

So, looking at your initial collection.  This would be less app intensive:

Set(NavItems, 
    Table(
        {Id: 7,
         ScreenName: Coalesce(varString.MakeRequest, "Make Request"),
         Description: Coalesce(varString.MakeRequestDescription, "Contact us with a request"),
         Screen: 'Request Screen',
         Image: cc_icon_request,
         URL: ""
        }
    )
)

NavItems is now a table with one record in it.

You can add as many as you want.  

Now, about the admin part.  If you have something distinctive in your table record to indicate the "audience"/visibility, let's say there is an admin column.  Then your formula would be this (and I'll add another record for fun) :

Set(NavItems, 
    Table(
        {Id: 7,
         ScreenName: Coalesce(varString.MakeRequest, "Make Request"),
         Description: Coalesce(varString.MakeRequestDescription, "Contact us with a request"),
         Screen: 'Request Screen',
         Image: cc_icon_request,
         URL: "",
         admin: false
        },
        {Id: 8,
         ScreenName: Coalesce(varString.MakeRequest, "Make Wish"),
         Description: Coalesce(varString.MakeRequestDescription, "Wish on your own time"),
         Screen: 'Wish Screen',
         Image: cc_icon_wish,
         URL: "",
         admin: true
        }
    )
)

 

Now, let's say you have some other variable in your app that indicates that the current user is an admin - let's call it varAdmin,  then on your Items property for the Menu component, you would have this:

   Filter(NavItems, !admin || admin = varAdmin)

For users that are not admin, they would only see record Id 7 from above.  For those that are admin, they would see 7 and 8.

 

Hopefully that is clear and helpful for you.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Awesome.   Thanks for sharing this additional bit of information, this is fantastic!

 

Sincerely,

Andrew Burns

RandyHayes
Super User
Super User

@AndrewB 

No problem Andrew.  Hope it is all helpful.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Helpful resources

Announcements

Exclusive LIVE Community Event: Power Apps Copilot Coffee Chat with Copilot Studio Product Team

  It's time for the SECOND Power Apps Copilot Coffee Chat featuring the Copilot Studio product team, which will be held LIVE on April 3, 2024 at 9:30 AM Pacific Daylight Time (PDT).     This is an incredible opportunity to connect with members of the Copilot Studio product team and ask them anything about Copilot Studio. We'll share our special guests with you shortly--but we want to encourage to mark your calendars now because you will not want to miss the conversation.   This live event will give you the unique opportunity to learn more about Copilot Studio plans, where we’ll focus, and get insight into upcoming features. We’re looking forward to hearing from the community, so bring your questions!   TO GET ACCESS TO THIS EXCLUSIVE AMA: Kudo this post to reserve your spot! Reserve your spot now by kudoing this post.  Reservations will be prioritized on when your kudo for the post comes through, so don't wait! Click that "kudo button" today.   Invitations will be sent on April 2nd.Users posting Kudos after April 2nd. at 9AM PDT may not receive an invitation but will be able to view the session online after conclusion of the event. Give your "kudo" today and mark your calendars for April 3rd, 2024 at 9:30 AM PDT and join us for an engaging and informative session!

Tuesday Tip: Unlocking Community Achievements and Earning Badges

TUESDAY TIPS are our way of communicating helpful things we've learned or shared that have helped members of the Community. Whether you're just getting started or you're a seasoned pro, Tuesday Tips will help you know where to go, what to look for, and navigate your way through the ever-growing--and ever-changing--world of the Power Platform Community! We cover basics about the Community, provide a few "insider tips" to make your experience even better, and share best practices gleaned from our most active community members and Super Users.   With so many new Community members joining us each week, we'll also review a few of our "best practices" so you know just "how" the Community works, so make sure to watch the News & Announcements each week for the latest and greatest Tuesday Tips!     THIS WEEK'S TIP: Unlocking Achievements and Earning BadgesAcross the Communities, you'll see badges on users profile that recognize and reward their engagement and contributions. These badges each signify a different achievement--and all of those achievements are available to any Community member! If you're a seasoned pro or just getting started, you too can earn badges for the great work you do. Check out some details on Community badges below--and find out more in the detailed link at the end of the article!       A Diverse Range of Badges to Collect The badges you can earn in the Community cover a wide array of activities, including: Kudos Received: Acknowledges the number of times a user’s post has been appreciated with a “Kudo.”Kudos Given: Highlights the user’s generosity in recognizing others’ contributions.Topics Created: Tracks the number of discussions initiated by a user.Solutions Provided: Celebrates the instances where a user’s response is marked as the correct solution.Reply: Counts the number of times a user has engaged with community discussions.Blog Contributor: Honors those who contribute valuable content and are invited to write for the community blog.       A Community Evolving Together Badges are not only a great way to recognize outstanding contributions of our amazing Community members--they are also a way to continue fostering a collaborative and supportive environment. As you continue to share your knowledge and assist each other these badges serve as a visual representation of your valuable contributions.   Find out more about badges in these Community Support pages in each Community: All About Community Badges - Power Apps CommunityAll About Community Badges - Power Automate CommunityAll About Community Badges - Copilot Studio CommunityAll About Community Badges - Power Pages Community

Tuesday Tips: Powering Up Your Community Profile

TUESDAY TIPS are our way of communicating helpful things we've learned or shared that have helped members of the Community. Whether you're just getting started or you're a seasoned pro, Tuesday Tips will help you know where to go, what to look for, and navigate your way through the ever-growing--and ever-changing--world of the Power Platform Community! We cover basics about the Community, provide a few "insider tips" to make your experience even better, and share best practices gleaned from our most active community members and Super Users.   With so many new Community members joining us each week, we'll also review a few of our "best practices" so you know just "how" the Community works, so make sure to watch the News & Announcements each week for the latest and greatest Tuesday Tips!   This Week's Tip: Power Up Your Profile!  🚀 It's where every Community member gets their start, and it's essential that you keep it updated! Your Community User Profile is how you're able to get messages, post solutions, ask questions--and as you rank up, it's where your badges will appear and how you'll be known when you start blogging in the Community Blog. Your Community User Profile is how the Community knows you--so it's essential that it works the way you need it to! From changing your username to updating contact information, this Knowledge Base Article is your best resource for powering up your profile.     Password Puzzles? No Problem! Find out how to sync your Azure AD password with your community account, ensuring a seamless sign-in. No separate passwords to remember! Job Jumps & Email Swaps Changed jobs? Got a new email? Fear not! You'll find out how to link your shiny new email to your existing community account, keeping your contributions and connections intact. Username Uncertainties Unraveled Picking the perfect username is crucial--and sometimes the original choice you signed up with doesn't fit as well as you may have thought. There's a quick way to request an update here--but remember, your username is your community identity, so choose wisely. "Need Admin Approval" Warning Window? If you see this error message while using the community, don't worry. A simple process will help you get where you need to go. If you still need assistance, find out how to contact your Community Support team. Whatever you're looking for, when it comes to your profile, the Community Account Support Knowledge Base article is your treasure trove of tips as you navigate the nuances of your Community Profile. It’s the ultimate resource for keeping your digital identity in tip-top shape while engaging with the Power Platform Community. So, dive in and power up your profile today!  💪🚀   Community Account Support | Power Apps Community Account Support | Power AutomateCommunity Account Support | Copilot Studio  Community Account Support | Power Pages

Super User of the Month | Chris Piasecki

In our 2nd installment of this new ongoing feature in the Community, we're thrilled to announce that Chris Piasecki is our Super User of the Month for March 2024. If you've been in the Community for a while, we're sure you've seen a comment or marked one of Chris' helpful tips as a solution--he's been a Super User for SEVEN consecutive seasons!       Since authoring his first reply in April 2020 to his most recent achievement organizing the Canadian Power Platform Summit this month, Chris has helped countless Community members with his insights and expertise. In addition to being a Super User, Chris is also a User Group leader, Microsoft MVP, and a featured speaker at the Microsoft Power Platform Conference. His contributions to the new SUIT program, along with his joyous personality and willingness to jump in and help so many members has made Chris a fixture in the Power Platform Community.   When Chris isn't authoring solutions or organizing events, he's actively leading Piasecki Consulting, specializing in solution architecture, integration, DevOps, and more--helping clients discover how to strategize and implement Microsoft's technology platforms. We are grateful for Chris' insightful help in the Community and look forward to even more amazing milestones as he continues to assist so many with his great tips, solutions--always with a smile and a great sense of humor.You can find Chris in the Community and on LinkedIn. Thanks for being such a SUPER user, Chris! 💪🌠

Tuesday Tips: Community Ranks and YOU

TUESDAY TIPS are our way of communicating helpful things we've learned or shared that have helped members of the Community. Whether you're just getting started or you're a seasoned pro, Tuesday Tips will help you know where to go, what to look for, and navigate your way through the ever-growing--and ever-changing--world of the Power Platform Community! We cover basics about the Community, provide a few "insider tips" to make your experience even better, and share best practices gleaned from our most active community members and Super Users.   With so many new Community members joining us each week, we'll also review a few of our "best practices" so you know just "how" the Community works, so make sure to watch the News & Announcements each week for the latest and greatest Tuesday Tips!This Week: Community Ranks--Moving from "Member" to "Community Champion"   Have you ever wondered how your fellow community members ascend the ranks within our community? What sets apart an Advocate from a Helper, or a Solution Sage from a Community Champion? In today’s #TuesdayTip, we’re unveiling the secrets and sharing tips to help YOU elevate your ranking—and why it matters to our vibrant communities. Community ranks serve as a window into a member’s role and activity. They celebrate your accomplishments and reveal whether someone has been actively contributing and assisting others. For instance, a Super User is someone who has been exceptionally helpful and engaged. Some ranks even come with special permissions, especially those related to community management. As you actively participate—whether by creating new topics, providing solutions, or earning kudos—your rank can climb. Each time you achieve a new rank, you’ll receive an email notification. Look out for the icon and rank name displayed next to your username—it’s a badge of honor! Fun fact: Your Community Engagement Team keeps an eye on these ranks, recognizing the most passionate and active community members. So shine brightly with valuable content, and you might just earn well-deserved recognition! Where can you see someone’s rank? When viewing a post, you’ll find a member’s rank to the left of their name.Click on a username to explore their profile, where their rank is prominently displayed. What about the ranks themselves? New members start as New Members, progressing to Regular Visitors, and then Frequent Visitors.Beyond that, we have a categorized system: Kudo Ranks: Earned through kudos (teal icons).Post Ranks: Based on your posts (purple icons).Solution Ranks: Reflecting your solutions (green icons).Combo Ranks: These orange icons combine kudos, solutions, and posts. The top ranks have unique names, making your journey even more exciting! So dive in, collect those kudos, share solutions, and let’s see how high you can rank! 🌟 🚀   Check out the Using the Community boards in each of the communities for more helpful information!  Power Apps, Power Automate, Copilot Studio & Power Pages

Find Out What Makes Super Users So Super

We know many of you visit the Power Platform Communities to ask questions and receive answers. But do you know that many of our best answers and solutions come from Community members who are super active, helping anyone who needs a little help getting unstuck with Business Applications products? We call these dedicated Community members Super Users because they are the real heroes in the Community, willing to jump in whenever they can to help! Maybe you've encountered them yourself and they've solved some of your biggest questions. Have you ever wondered, "Why?"We interviewed several of our Super Users to understand what drives them to help in the Community--and discover the difference it has made in their lives as well! Take a look in our gallery today: What Motivates a Super User? - Power Platform Community (microsoft.com)

Top Solution Authors
Top Kudoed Authors
Users online (5,879)