Skip to main content

Notifications

Power Apps - Power Apps Pro Dev & ISV
Answered

Pull the next item in a ListBox Not Selected

Like (1) ShareShare
ReportReport
Posted on 4 Oct 2024 17:02:15 by 233
Greetings!
I have a ListBox that pulls from a Sharepoint choice collumn. I am trying to get the choices not selected from the ListBox to display in a button. 
So far I can display all the selected choices using 
Concat(ListBox.SelectedItems,Value, ",")
on the text property of the button.
However, I either need all the ones that not selected in the list or the next available choice that is not selected.
Thoughts?
 
I can get the last item selected using this:
Last(ListBox.SelectedItems).Value 
 
However, I need the next one not selected.
Thank you :)
  • Verified answer
    FLMike Profile Picture
    FLMike 29,371 on 04 Oct 2024 at 19:15:10
    Pull the next item in a ListBox Not Selected
    HI
     
    If you want to find out which ones are not selected already do this.
     
    My example uses ComboBoxes but its the same for ListBox)
    So I filter the Choice based on what is Not in the Source ComboBox4's SelectedItems
     
    Filter(Choices('MyChoice2 (TableAS)'),
          Not(Value in ComboBox4.SelectedItems)
    )
     
    This will return the list that have not been selected.
     
  • MattMan - nah nah nah nah nah nah Profile Picture
    MattMan - nah nah n... 6 on 04 Oct 2024 at 18:45:33
    Pull the next item in a ListBox Not Selected
    I would try a substitute function. 
     
    Begin by creating a variable that concatenates your drop down values with a formula like the following using the onchange property of the drop down :
     
    Set(varlist, concat(Self.Selecteditems,value)).
     
    Then create a second variable that is composed of the "items" that are listed in the drop down menu.
     
    Your button text then can be created using the two variables and the substitute function. Something like : 
     
    Substitute(varlist.Text,"(1)", "")

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #9 Get Recognized…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 144,411

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 64,328

Leaderboard