cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Rules not running

Hi all,

 

I'm struggling to get my rules to work. They're being created fine however none are running. I tried making a 'test' app to see if the problem still persists and it does. Here's what i'm doing:

 

1) On my button - I add a rule with the condition 'Pressed' - Button.Pressed

 

2) I define my actions (what i'm defining doesn't change the outcome i've realised through testing)

 

3) I click done

 

And nothing happens when run.. I tried to add the rule to the 'OnSelect' option of the button and still nothing. Has anyone got an idea as to what i'm doing wrong?

 

Kindest regards,

Colleen

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Rules not running

Hi Colleen, You may switch to a variable.

Under the Button OnSelect property, enter the code below:

UpdateContext({Visible1:true})

Then under the Visible property of the Button2 and Form1_1, enter:

Visible1

After that, with the OnVisible property of the screen, enter the following:

UpdateContext({Visible1:false})

To Reset the Variable value.

 

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
3 REPLIES 3
Highlighted
Community Support Team
Community Support Team

Re: Rules not running

Hi @Anonymous,

 

I believe the explanation of 

 

The  documentation from PowerApps is misleading: it’s not set to true while the button is pressed, it’s more of a “pulse” property – when you press the button (or to be more specific, when you release the button), the Pressed value will be set to true, and immediately after it will be set to false (I'll talk to the documentation owner to have it updated).

 

The main scenario for the Pressed property is in a Reset scenario. All controls that have a Reset property need the value bound to that property to change for the data flow to “tell” the control that its reset property changed. So if you want to reset one (or more) controls with a click of a button, you can set the properties of those controls to ‘Button1.Pressed’ and you’ll get the controls reset when the button is pressed.

 

 

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Re: Rules not running

Hi @v-micsh-msft - thanks for getting back to me.

 

I think I understand what you're saying.. Do you have any suggestions as to what to do to make it work? This is what i have currently:

 

image.png

How can i make this work? I don't need to use a rule - i'm open to any suggestions that achieve the same thing.

 

Kind regards,

Colleen

Community Support Team
Community Support Team

Re: Rules not running

Hi Colleen, You may switch to a variable.

Under the Button OnSelect property, enter the code below:

UpdateContext({Visible1:true})

Then under the Visible property of the Button2 and Form1_1, enter:

Visible1

After that, with the OnVisible property of the screen, enter the following:

UpdateContext({Visible1:false})

To Reset the Variable value.

 

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.