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

Component button using 12 times. Need output which button is clicked on the first screen

I'm having a component with a button and i use this component 12 times at the first screen. On a later screen do i want to know which button of these 12 is clicked latest. 

I already tried to create a variable on the OnSelect in the button (in component). But I cant use this variable in a screen (doenst recognize).
Set(LatestClickedButton; Component.Text)

Does anyone has a solution? Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
K-A-R-L
Level 10

Re: Component button using 12 times. Need output which button is clicked on the first screen

Hi @Oos ,

 

Try Collecting the selected Buttons (CollectedButton) with a TimeStamp > Sort Collection by column TimeStamp > Set the Last Item on the Collection Set(LastesClickedButton, Last(CollectedButtons).ComponentTextColumn)

 

Please let me know if you need help with this.

Thanks,
K-A-R-L


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
K-A-R-L
Level 10

Re: Component button using 12 times. Need output which button is clicked on the first screen

Hi @Oos ,

 

Try Collecting the selected Buttons (CollectedButton) with a TimeStamp > Sort Collection by column TimeStamp > Set the Last Item on the Collection Set(LastesClickedButton, Last(CollectedButtons).ComponentTextColumn)

 

Please let me know if you need help with this.

Thanks,
K-A-R-L


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Community Support Team
Community Support Team

Re: Component button using 12 times. Need output which button is clicked on the first screen

Hi @Oos ,

Do you custom a Component control within your app?

Do you want to reference the variable set/initialized within the Component control in your app screen?

 

If you want to reference the variable set/initialized within the Component control in your app screen, you must define a Output property within your Component control, then bind the variable to the Output property in your Component control.

More details about defined a Output property within a Component control, please check the following GIF screenshot:Test.gif

On your side, you should defined a Output property (called "LatestClickedButtonValue") within your Component control above above screenshot.

Set the OnSelect property of the Button within the Component control to following:

Set(LatestClickedButton, Button1.Text)

Then within "Advanced" tab -> "Data" part, set the LatestClickedButtonValue (Output) property to following:

LatestClickedButton

After that, when you insert the Component control into your screen, you could reference the variable through the LatestClickedButtonValue (Output) property of the Component control using the following formula:

Component1_1.LatestClickedButtonValue

1.JPG

 

More details about the Output property of a Component control, please check the following article:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/create-component#custom-properties

 

Please consider take a try with above solution, then check if the issue is solved.

 

Best regards,

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.

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (10,380)