cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Oos
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
K-A-R-L
Solution Specialist
Solution Specialist

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

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

v-xida-msft
Community Support
Community Support

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
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (3,320)