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

Fill Property is Indirect Function?

Hello!

 

I am designing an app that will be used across multiple sub-businesses so instead of building each business their own app/color scheme, I'd like to set the colors as variables within the app that will reference a variable.

 

Ex: 

 - At the app login, the user selects their company  (varCompany = CompanyA) and navigates to a menu

 - I have a box on a settings screen set as "Color1_CompanyA" another box as "Color1_CompanyB"....etc.

 - I want all the colors to be dynamic based on those setting screen colors

 

Question: I want to set the fill color for the box on the the menu as Color1_CompanyA.fill HOWEVER I need the "CompanyA" piece to be dynamic so I'm thinking it needs some sort of indirect coding?  Something like the fill property is Color1_varCompany.fill but how do I use a variable inside a fill property name? 

 

Is this possible in Power Apps?

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User III
Super User III

@AppsBuilder310 

You can certainly do all of this in PowerApps.

If you are indirectly referencing another control to derive your fill color, then you can use a formula such as this on the Fill property:

Switch(varCompany, "CompanyA", Color1_CompanyA.Fill, "CompanyB", Color1_CompanyB.Fill)

 

However, it would be less work for you if you had a single box in your app (companyColor) and set the Fill of that to:

Switch(varCompany, "CompanyA", Red, "CompanyB", Blue)

(just using Red and Blue as an example)

 

Then in the rest of your app, set the Fill properties of the controls you want to be dynamic to : companyColor.Fill

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

2 REPLIES 2
RandyHayes
Super User III
Super User III

@AppsBuilder310 

You can certainly do all of this in PowerApps.

If you are indirectly referencing another control to derive your fill color, then you can use a formula such as this on the Fill property:

Switch(varCompany, "CompanyA", Color1_CompanyA.Fill, "CompanyB", Color1_CompanyB.Fill)

 

However, it would be less work for you if you had a single box in your app (companyColor) and set the Fill of that to:

Switch(varCompany, "CompanyA", Red, "CompanyB", Blue)

(just using Red and Blue as an example)

 

Then in the rest of your app, set the Fill properties of the controls you want to be dynamic to : companyColor.Fill

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

AppsBuilder310
Frequent Visitor

This is perfect!  Just tried the second solution out and it works great.  Thanks for your help!

Helpful resources

Announcements
User Groups Public Preview

Join us for our User Group Public Preview!

Power Apps User Groups are coming! Make sure you’re among the first to know when user groups go live for public preview.

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (35,740)