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

Set Global Control Values

Hi,

 

A bit of a question and pet peeve that I think can make PowerApps a less attractive option for app development at times.

 

I can't see how it's possible to set global values for controls i.e. a radio button in a SharePoint form. Any new radio button I add to my app comes loaded with FalseText of 'Off' and TrueText of 'On'. In 99% of my circumstances, I want this to say 'Yes' or 'No' so what I have to do is unlock all data cards and customise the False/True text.

 

This is incredibly time-consuming on longer forms; realistically I'd expect there to be a way to set these values and then overwrite in the small number of circumstances where I'd need something else i.e. how inline-styles can override CSS.

 

Am I missing something because I haven't seen anything on the ideas board or forums that suggest this is possible.

 

To clarify, I am using global variables for some fields i.e. for a multi-line text box I have a height variable but again, rather than being able to set this once and then overwrite where necessary I have to edit each individual box which starts to get both tedious and laggy over time!

 

Any thoughts/ideas/suggestions?

3 REPLIES 3

@BMarsh4 

 

 

I have a height variable but again, rather than being able to set this once and then overwrite where necessary I have to edit each individual box which starts to get both tedious and laggy over time!

 

 

Instead of variable, we suggest you have a "Hidden Screen" and have hard coded control values there.

From other screens, add other controls with properties that directly reference the control properties of your "base" control on the "Hidden Screen".

 

E.g. 

 

  1. Add a new screen called MasterScreen
  2. In that screen, add some control, called it MyMasterControl1
  3. Set properties manually (hard coded)
  4. From other screens, from other controls, reference property such as like this:
    MyMasterControl1.Height

 

Instead of setting variables all the time for control properties, try this above instead and see if it is better for you.

To take this a bit further, controls could be added via copying the master controls. While this has its own issues, I find it is helpful in some scenarios. Though, ultimately, OP is right in that its confusing why a new forms tool doesn't support something like CSS, or at least give us some sort of "theme" capability like visual studio had 20 years ago. (or, how about a format painter like word had over 25 years ago). 

 

One thing that may help is grouping. You can group controls, and then set common properties. Though, this doesn't work for forms. 

@BMarsh4  

 

Yes, as @Mike2500  said, copying and pasting the control itself can be helpful.

 

You would usually want to do this after making the Master control, making one instance of the control, and then it would be that instance (the one where you edit the properties to reference the master properties) that should be copied and pasted, so that each instance of the control references the same Master control properties.

 

However, the definition of this first instance of each type of control, can be tedious at times.

 

We had an idea we submitted where we thought it would be nice to be able to take a hard coded control, and clone a copy of it that already had all the MasterControl.Property values initialized. Then we could go through and decide which properties should be unique to the instance. Because this process can be tedious to do manually to do this for the BorderStyle, the X, the Y, the Height, and all the other number of properties

PowerApps Studio: One-Click Master Element Instance Reference 

 

Also, yes it might be nice to have other theme related capabilities as well in addition to the above.

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Top Kudoed Authors
Users online (2,077)