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

Select next record from a ComboBox

Hi guys

 

Soo i have this combobox wich i load my data (ID), filter by "Gallery5.Selected.ID", but i have two records associated with the selected ID, by default i have one of the records alredy selected, soo far soo good, my goal is to click a button and select the next record existing on my combobox without switch it manually.

 

Any thougths? ( Forgive me for a not perfect english, not a ative speaker)

 

Many thanks,

 

Pedro

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Select next record from a ComboBox

Hi @perusso ,

Could you please share a bit more about the formula you typed within the Items property of the ComboBox control?

Could you please share more details about the DefaultSelectedItems property of your ComboBox control?

Further, do you want to select the next match record on your ComboBox when you click the Button?

 

Based on the needs that you mentioned, I have made a test on my side, please take a try with the following workaround:

The data structure of my data source as below:5.JPG

 

6.JPGMy App's configuration as below:4.JPG

 

7.JPG

 

8.JPG

 

9.JPG

Set the OnStart property of the App control to following:

ClearCollect(CoursesCollection, '20181019_case9_Courses');
Set(Index, 1)

On your side, you should add the following formula within the OnStart property of the App control or OnVisible property of the first screen of your app:

Set(Index, 1)             /* <-- Initialize the Index variable */

 

Set the Items property of the Gallery  (Gallery1) to following:

'20181019_case9_OutComes'      /* <-- Here type your own data source to populate your Gallery */

Set the OnSelect property of the Gallery to following:

Set(Index, 1)

 

Set the Items property of the ComboBox to following:

Filter(CoursesCollection, Outcome.Value = Gallery1.Selected.Title)   /* <-- Filter reocrds based on selected item in Gallery1 */

On your side, you should type:

Filter('YourDataSource', FilteredColumn = Gallery5.Selected.ID)  /* <-- Filter records based on selected item in your Gallery. The FilteredColumn represents the column you want to compare with the ID column value of the Gallery selected item*/

Set the DefaultSelectedItems property of the ComboBox to following:

Last(
FirstN(Filter(CoursesCollection, Outcome.Value=Gallery1.Selected.Title), Index)
)

On your side, you should type:

Last(
     FirstN(Filter('YourDataSource', FilteredColumn = Gallery5.Selected.ID), Index)
)

 

Set the OnSelect property of the "Next" button to following:

Set(Index, Index+1)

Please check the following GIF screenshot for more details:Test.gif

 

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.

View solution in original post

2 REPLIES 2
Community Support Team
Community Support Team

Re: Select next record from a ComboBox

Hi @perusso ,

Could you please share a bit more about the formula you typed within the Items property of the ComboBox control?

Could you please share more details about the DefaultSelectedItems property of your ComboBox control?

Further, do you want to select the next match record on your ComboBox when you click the Button?

 

Based on the needs that you mentioned, I have made a test on my side, please take a try with the following workaround:

The data structure of my data source as below:5.JPG

 

6.JPGMy App's configuration as below:4.JPG

 

7.JPG

 

8.JPG

 

9.JPG

Set the OnStart property of the App control to following:

ClearCollect(CoursesCollection, '20181019_case9_Courses');
Set(Index, 1)

On your side, you should add the following formula within the OnStart property of the App control or OnVisible property of the first screen of your app:

Set(Index, 1)             /* <-- Initialize the Index variable */

 

Set the Items property of the Gallery  (Gallery1) to following:

'20181019_case9_OutComes'      /* <-- Here type your own data source to populate your Gallery */

Set the OnSelect property of the Gallery to following:

Set(Index, 1)

 

Set the Items property of the ComboBox to following:

Filter(CoursesCollection, Outcome.Value = Gallery1.Selected.Title)   /* <-- Filter reocrds based on selected item in Gallery1 */

On your side, you should type:

Filter('YourDataSource', FilteredColumn = Gallery5.Selected.ID)  /* <-- Filter records based on selected item in your Gallery. The FilteredColumn represents the column you want to compare with the ID column value of the Gallery selected item*/

Set the DefaultSelectedItems property of the ComboBox to following:

Last(
FirstN(Filter(CoursesCollection, Outcome.Value=Gallery1.Selected.Title), Index)
)

On your side, you should type:

Last(
     FirstN(Filter('YourDataSource', FilteredColumn = Gallery5.Selected.ID), Index)
)

 

Set the OnSelect property of the "Next" button to following:

Set(Index, Index+1)

Please check the following GIF screenshot for more details:Test.gif

 

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.

View solution in original post

perusso
Level: Powered On

Re: Select next record from a ComboBox


 

Hi there friend,

Many thanks for the reply to my problem, i can tell you that was exacly what i was looking for, and your code indeed solved my issues, my program is now working was i wished in the first place 

 

 

Many thanks,

 

Pedro

 

 

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

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

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 (9,821)