cancel
Showing results for 
Search instead for 
Did you mean: 

Button.Pressed trigger an action

Hi

 

In Project Siena, any items (eg Shape, Box) can be triggered, example Visibility using Button.Pressed function.

Example: 

- A TextBox.Visible = Button1.Pressed

- So, when PRESSING Button1, TextBox will be visible "true", and false when button is released.

 

I wish this function can be extended in PowerApps.

(I have tried for months and hopefully this function will restore OR maybe I am wrong in the setting?)

 

Moreoever, I suspect this maybe due to missing function of PRESSED as shown in tutorial.

 

 

 

Pressed ... not shown in PowerApps Studio

 

IT is possible in Project Siena

 

Thanks in advance.

 

Note:  I am using this function to trigger TImer so that I can achieve dual function

- Button.OnSelect = ShortPress

- Button.Pressed (with timer, say, 1 sec ) = LongPress

 

This is make the apps function better, even withotu PowerApps providing LONG PRESS function.

 

TQ and have a nice day.

hpkeong

 

 

Status: Completed
Comments
Level 8

Hi,

 

If you use an variable, in the OnSelect field of the button you can UpdateContext({buttonPressed:!buttonPressed}) and in the OnVisible field of the screen you put the following code UpdateContext({buttonPressed:false}). Finally in the textbox you wanna show if the button is pressed, on the Visible field you put the variable.

 

If you didn't understand feel free to contact me.

 

Best regards,

Jorge Moreira

Level 10

Hi @jmoreira_myp

 

Thanks a lot for your kind sharing.

 

Anyway, I guess you might misunderstood my intention.

Please refer to our thread between myself and PG Staff on what am I requesting for improvement to PowerApps.

 

https://powerusers.microsoft.com/t5/PowerApps-Forum/Visible-on-ButtonPressed/m-p/34098#M14037

 

Meantime, do visit our Blogs for PowerApps on UpdateContext, too.

 

Anyway, thanks a lot.

 

Level: Powered On

Hi, 

I have an app for liking and disliking outfits

I have dislikes and likes columns in my excel data. 

On the app I made LIKE and DISLIKE buttons. 

I set the onselect property of like button as: UpdateContext( {LIKESVAR: (LIKESVAR + 1)} )

and default property of the datacard as: LIKESVAR + LIKES 

When I run the app and click like, the value in LIKES increases but the excel data doesn't get updated. How can I do that? 

 

Thanks,

PowerApps Staff
Status changed to: Completed