cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate V
Advocate V

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
Highlighted
Solution Specialist
Solution Specialist

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
Highlighted
Solution Specialist
Solution Specialist

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

Highlighted
Community Support
Community Support

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
Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (5,705)