cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Mgodby
Post Patron
Post Patron

Is there any way to programmatically spawn in controls?

In our app, we have circles that we associate with records in a table. What I'm doing currently, is having 200 circles on the screen, and then storing all of the records into a collection. And what I then do is, for every circle, check if the number of items in the collection matches their number. So circle40 will look if there is a 40th record in the collection, if there is, it is visible, if not, it invisible. 

But the issue with this is that we always have 200 circles no matter how many records there are. Is there a way in PowerApps, to programmatically spawn circles and then assign values to certain properties like X, Y, Height, Width and OnSelect etc.? Or is there a way to clone a circle and then assign its properties values?


If it is not possible, that's fine. I just need to confirm. Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@Mgodby 

You can't really do that in PowerApps.  You'd have to have them all in your app.

They can all be dynamic based on properties...so, for example, if you had a table of records with some value, an X a Y, Height and Width, and then based your circles off of that AND, if something like the value was 0 (or something else) then you could set the Visible to false.

 

I am assuming your circles are random (or to some pattern) on the screen and not linear and can be part of a Gallery.

 

I hope this is 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.
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

2 REPLIES 2
RandyHayes
Super User
Super User

@Mgodby 

You can't really do that in PowerApps.  You'd have to have them all in your app.

They can all be dynamic based on properties...so, for example, if you had a table of records with some value, an X a Y, Height and Width, and then based your circles off of that AND, if something like the value was 0 (or something else) then you could set the Visible to false.

 

I am assuming your circles are random (or to some pattern) on the screen and not linear and can be part of a Gallery.

 

I hope this is 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.
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

Yeah for the properties I get the item from the collection and then set the properties for the circle. So circle 22 gets the 22nd item in the collection's values set for X and Y for example. Thank you. I just wanted to confirm that this was impossible since I already kind of assumed it was.  

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,687)