cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
LauraEmberson
Level: Powered On

Rules, visibility and If statements

Hi All,

 

I am have a screen which contains buttons to other screens. I am using rules, that once the questions are complete, the button goes green to let them know they have completed it. This is working great. Ace.

 

However, I have one button which goes onto another screen with buttons for questions to fill in (dependent on previous choices in the app).

 

I will attach photos to help explain.

 

Basically my rules work for these sub buttons to turn green when the relevant questions are completed. (rule based on visibility of a tick showing on the questions) However, I need my initial screen button to go green IF the buttons visibilty on the other screen is true & the green rule is true.

 

The button I need to go green on the initial screen is called WorkTypeQuestion.

 

The second image is the second screen which has visibility rules applied to the buttons if previously chosen and will go green if the questions are complete. The screen has 7 different buttons. 


Really hope this makes sense.

 

Can't seem to find If statements working in the conditions of rules. 

 

Any ideas?

 

Thank you...

3 REPLIES 3
Mike8
Level 10

Re: Rules, visibility and If statements

Hello Laura,

It would be helpful if can you share the expressions that you use on the visible and fill property of the buttons.
In general, I think that you need to copy and compine the expressions from the properties Visible and Fill of the buttons in the second screen to the Visible property of the button WorkTypeQuestion in the initial screen.


Community Support Team
Community Support Team

Re: Rules, visibility and If statements

Hi @LauraEmberson,

 

Could you please share a bit more about the rules that you mentioned?

Could you please show more details about the formula that you provided within the Visible property and Fill property of the Button controls within your second screen?

 

I agree with @Mike8's thought almost. You could consider take a try to apply the expressions from the properties Visible and Fill of the buttons in your second screen into the Visible property of the button WorkTypeQuestion in the initial screen

 

I assume that there are three buttons within your second screen, you want the WorkTypeQuestion button to go green when the green rule of three buttons is true.

 

I have made a test on my side, please take a try with the following workaround:4.JPG

 

5.JPG

 

 

If you want to achieve your needs using rules, please take a try with the following GIF screenshot:Test1.gif

 

Within the Conditions box of the above Rule, type the following formula:

MainsButton.Fill=Color.Green&&PEJoinButton.Fill=Color.Green&&MetersButton.Fill=Color.Green

Note: On your side, you should use your own Green color instead of the Color.Green within above formula.

 

In addition, you could also consider take a try with following workaround (instead of using Rules):

 

Set the Fill property of the WorkTypeQuestion button to following formula:

If(
MainsButton.Fill=Color.Green&&PEJoinButton.Fill=Color.Green&&MetersButton.Fill=Color.Green,
Color.Green,
RGBA(255, 255, 255, 1) )

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
LauraEmberson
Level: Powered On

Re: Rules, visibility and If statements

Hi Both,

 

 

thank you for your help. The problem is I have 7 buttons which could be chosen with any combination.  (Eg, button 2&5 or 3&5 or 1234 etc etc). Therefore it needs to recognise if those buttons are visible/chosen and green to then turn the 'Work Type Question' green. 

 

The visibility on the 7 buttons are as follows:

If("Mains" in DataCardValue10.SelectedItems.Value,true,false)

 

So the user can only enter the question section if chosen previously from a choice column. This all works fine. THEN if those questions are chosen and completed a tick will appear. The Buttons leading to the questions (Screen 2) currently have forumlas such as:

 

If(!IsBlank(DataCardValue94.Selected.Value),true,false)&&If(!IsBlank(DataCardValue95.Selected.Value),true,false)&&If(!IsBlank(DataCardValue96.Selected.Value),true,false)&&If(!IsBlank(DataCardValue97.Selected.Value),true,false)&&If(!IsBlank(DataCardValue98.Selected.Value),true,false)&&If(!IsBlank(DataCardValue99.Selected.Value),true,false)&&If(!IsBlank(DataCardValue100.Selected.Value),true,false)&&If(!IsBlank(DataCardValue101.Selected.Value),true,false)&&If(!IsBlank(DataCardValue102.Selected.Value),true,false)&&If(!IsBlank(DataCardValue104.Selected.Value),true,false)&&If(!IsBlank(DataCardValue105.Selected.Value),true,false)&&If(!IsBlank(DataCardValue106.Selected.Value),true,false)

 

GO GREEN.

 

(ie if all not blank go green)

 

So I need the first screen button to recognise first if the button is visibility ON and if it is, whether the button is green.

 

 

Hoping this is clearer now?


Thank youuu.

 

Helpful resources

Announcements
thirdimage

Power Automate 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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,111)