cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Super User
Super User

Custom color template reference question

While updating an app, I began to wonder about how best to reference custom color templates that are built into my app.

 

For some background, I have three color templates that are stored in Collections: BrandedColor, ColorBlindColor, and HighContrastColor. I then have a "master" color template Collection, ColorSettings, that stores the color settings of whichever color the user chose. (This is also saved to the device so the color choice is persistent.)

 

When I first built the app, I used a LookUp on the ColorSettings Collection to find colors. So to assign the text color, I entered

 

LookUp(ColorSettings, Name = "Text1", Value) 

 

in the Color field of the text label. Some time ago, I started the practice of using "reference items" to get these colors. For instance, I have a hidden text label named Color1 on one of my screens which has the above code in it's Color field. I reference it using

 

Color1.Color

 

in the Color field of another text label. 

 

My question: is the "reference item" method better than the LookUp method as far as performance is concerned? And a quick followup: is there a better method than either of those? The "reference item" method seems much easier to use, especially in apps with lots of pages, but I can't really tell if either method performs better. What say you, PowerApps community?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-zhta-msft
Level 8

Re: Custom color template reference question

 

Hi @ wyotim,

 

“LookUp” method is better than “reference item” based on my understanding.

 

I suspect the color property would first reference the Color1.Color, and then take use of the LookUp function to find the proper color.

 

Besides, if the color has been defined within the Color1.Color, then it should be better to reference the color property directly, which is easier to implement.

 

Hope this helps.

 

Regards,

Zheng

View solution in original post

2 REPLIES 2
v-zhta-msft
Level 8

Re: Custom color template reference question

 

Hi @ wyotim,

 

“LookUp” method is better than “reference item” based on my understanding.

 

I suspect the color property would first reference the Color1.Color, and then take use of the LookUp function to find the proper color.

 

Besides, if the color has been defined within the Color1.Color, then it should be better to reference the color property directly, which is easier to implement.

 

Hope this helps.

 

Regards,

Zheng

View solution in original post

Super User
Super User

Re: Custom color template reference question

@v-zhta-msftThank you for responding! 

 

If I am understanding correctly, it sounds like using my "reference item" method would be a two-step process as the LookUp function would get called with each reference to the Color1 object. That was actually the part I wasn't sure of: if the LookUp was done once for the object it was in and then the result was referenced or if the LookUp had to run again when it was referenced. That is a bit of a bummer because the reference method is much nicer to look at, function-wise. C'est la vie!

 

 

Thanks again! I appreciate the information.

Helpful resources

Announcements
thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (4,915)