web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Move checked boxes to ...
Power Apps
Unanswered

Move checked boxes to the top

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

This is my filter when a box is checked I want it to stay at the top. When the app is reloaded the previous checkboxes go back to their original placement. The boxes they checked last time are saved and reset to their original positions. How can I bind them to the top so they dont reset when the app is opened back up? Filter(
collCCBMasterData,
If(
IsBlank(ComboBox1.Selected.Result) || ComboBox1.Selected.Result = "All",
true,
'Functional Area' in ComboBox1.SelectedItems
) && If(
IsBlank(ComboBox1_1.Selected.Result) || ComboBox1_1.Selected.Result = "All",
true,
'Backlog Status' in ComboBox1_1.SelectedItems
) && If(
IsBlank(Filter.Text),
true,
Filter.Text in 'Requirement Source'
) && If(
IsBlank(Search_.Text),
true,
Search_.Text in Name
)
)
,CheckBoxColumn,Descending)

 

This is the default for my checkbox If(
!varChangeFlag,
If(
(ThisItem.Title in collPrevUserVoting.Title || ThisItem.Title in collSelOptions.selName),
true,
false
),
If(
ThisItem.Title in collSelOptions.selName,
true,
false
)
)

Categories:
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    Please again try changing your formula to the following:

    SortByColumns(
     AddColumns(
     Filter(
     collCCBMasterData,
     If(IsBlank(ComboBox1.Selected.Result) || ComboBox1.Selected.Result = "All", true,
     'Functional Area' in ComboBox1.SelectedItems) && 
     
     If(IsBlank(ComboBox1_1.Selected.Result) || ComboBox1_1.Selected.Result = "All", true,
     'Backlog Status' in ComboBox1_1.SelectedItems) && 
     
     If(IsBlank(Filter.Text), true, Filter.Text in 'Requirement Source') && 
     
     If(IsBlank(Search_.Text), true, Search_.Text in Name)
     ),
     "CbVal", If(CheckboxColumn, 1, 0)
     )
     "CbVal", Descending
    )

    This works 100% as mentioned in our other thread.  If it is causing problems then there is some other issue to be resolved.  Particularly, the CheckboxColumn - if that is truly a Boolean column, then this all should work smoothly. 

     

    Also, if you still want to apply this with a Toggle, then my other post formula still stands.

     

    However, I am not entirely sure what you are trying to do with the Default value on the Checkbox - can you explain as that is different than what you had presented before.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I am just going to show all related code to help. ClearCollect(collUserVoting,Sort(Filter('CCB Voting','Created By'.Email = varUser.Email),Created,Descending));
    Set(varlastSubDate,First(collUserVoting).Date);
    ClearCollect(collPrevUserVoting,Filter('CCB Voting','Created By'.Email = varUser.Email And Date = varlastSubDate));
    Clear(collSelOptions); - On start
    ForAll(collPrevUserVoting,Collect(collSelOptions,{selName:Title}));

    Collect(
    collSelOptions,
    {selName:ThisItem.Title}
    );
    UpdateContext({varChangeFlag:true}); Patch(collCCBMasterData,ThisItem,{CheckBoxColumn:true}) - This is in both check and uncheckThe default is how the previous answers are saved and loaded in. @RandyHayes I don't know how else to explain

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    It says it is expecting 2 arguments and still accepting a boolean. I will try anything can I take out the CheckBoxColumn in excel and just create something through powerapps instead. @RandyHayes 

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    Okay, there are typos sometimes!  I had to recreate your scenario in an app to see what is at play.

    First, you have two text inputs called Filter and Search.  I would immediately rename them as those are going to conflict with built-in functions.  So, Filter becomes txtFilter and Search becomes txtSearch.

    Now this formula...

    SortByColumns(
     AddColumns(
     Filter(
     collCCBMasterData,
     If(IsBlank(ComboBox1.Selected.Result) || ComboBox1.Selected.Result = "All", true,
     'Functional Area' in ComboBox1.SelectedItems) && 
     
     If(IsBlank(ComboBox1_1.Selected.Result) || ComboBox1_1.Selected.Result = "All", true,
     'Backlog Status' in ComboBox1_1.SelectedItems) && 
     
     If(IsBlank(txtFilter.Text), true, txtFilter.Text in 'Requirement Source') && 
     
     If(IsBlank(txtSearch.Text), true, txtSearch.Text in Name)
     ),
     "CbVal", If(CheckboxColumn, 1, 0)
     ),
     "CbVal", Descending
    )

     

    Beyond that, there was only a comma missing in the last formula I gave you.

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I am still getting the same error expecting a boolean @RandyHayes 

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    Yes, so this is saying that your Checkbox field is NOT being seen as a Boolean.

    To be certain, you DO have a Checkbox field in your data collection?  You mentioned this came from your Excel sheet?

     

    I have the same setup now here with a "made up" datasource to mimic what you are seeing.  The Checkbox field in my collection IS a Boolean, and it is just fine.  So, please review your Checkbox column in your Excel file.  If it is being brought in as Text, then change the formula to this:

    SortByColumns(
     AddColumns(
     Filter(
     collCCBMasterData,
     If(IsBlank(ComboBox1.Selected.Result) || ComboBox1.Selected.Result = "All", true,
     'Functional Area' in ComboBox1.SelectedItems) && 
     
     If(IsBlank(ComboBox1_1.Selected.Result) || ComboBox1_1.Selected.Result = "All", true,
     'Backlog Status' in ComboBox1_1.SelectedItems) && 
     
     If(IsBlank(txtFilter.Text), true, txtFilter.Text in 'Requirement Source') && 
     
     If(IsBlank(txtSearch.Text), true, txtSearch.Text in Name)
     ),
     "CbVal", If(CheckboxColumn="true", 1, 0)
     ),
     "CbVal", Descending
    )
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    That is causing the oncheck and uncheck to not work. I don't have a checkbox column collection.. It is just a column heading in an excel sheet. @RandyHayes 

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    Yes, I understand it is a column in your Excel file.  The issue is that many times PowerApps will read a (seemingly) true/false Boolean column as a text column.  If it is, then applying Boolean logic on it will not work.

     

    If you put a simple Label on the screen and set the Text to First(colCCBMasterData).CheckboxColumn you will see in the formula editor that it will tell you the data type of that Checkbox.

    Please make sure it shows Boolean if it shows Text then PowerApps is seeing that column as text and we need to work with it as such.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Nevermind the name was wrong because I copied it. There is no error now, it is just blank@RandyHayes 

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    Can you tell me which Identifier it says is not recognized?

    If it is the CheckboxColumn, then there is an issue that you have no such field in your collection, check your collection and the name.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 232 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 202 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 122

Last 30 days Overall leaderboard