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 / Arranging Blank Rows a...
Power Apps
Unanswered

Arranging Blank Rows and Sorting Complexity in Gallery Display

(0) ShareShare
ReportReport
Posted on by 18

i created two Screen  with two scrollable gallery  the first screenn named " Livrable en attente" 

it contains different column from a sharepoint list  (Semaine , Description,type ....) 

meryem_gz_1-1693307577904.png

 

for me the purpuse of the first Screen is to show only the rows with this condition 

 

If(IsBlank(Label16_1.Text) || Label16_166.Text="true" ;true;false)

 

 Label16_1 is Semaine  and Label16_166 is  Reccurent : which means that if the week is empty and if recuurent true then show me those rows 

but in the second screen named " livrable Planifié" 

meryem_gz_0-1693307121382.png

they show me the rows with this condition : 

If(!IsBlank(Label16_14.Text)||Label16_28.Text="Cancelled";true;false)

 Label16_14 is "Semaine column " the same one 

The challenge I'm facing involves the visibility of rows within a gallery when certain conditions are applied. Specifically, I want to ensure that even though some rows might appear blank due to applied conditions, those invisible rows should still be positioned at the bottom of the gallery. However, there's an additional issue related to the code in the "Items" property of the gallery. This code is responsible for implementing a complex filtering mechanism, including sorting rows by ascending date. I'm uncertain about how to address this problem. I need a solution that allows me to keep the blank rows at the bottom of the gallery while preserving the existing code within the "Items" property, which is responsible for filtering and sorting.

the code of my Items property 

If(
 (IsBlank(DatePicker1_1.SelectedDate) && !IsBlank(DatePicker1_7.SelectedDate)) ||
 (!IsBlank(DatePicker1_1.SelectedDate) && IsBlank(DatePicker1_7.SelectedDate));
 SortByColumns(
 Filter(
 test;
 IsBlank(ComboBox_Priorité_1.SelectedItems.Value) || IsEmpty(ComboBox_Priorité_1.SelectedItems.Value) || Priorité.Value = ComboBox_Priorité_1.Selected.Value;
 IsBlank(ComboBox_type_1.SelectedItems.Value) || IsEmpty(ComboBox_type_1.SelectedItems.Value) || TYPE.Value = ComboBox_type_1.Selected.Value;
 IsBlank(ComboBox_nature_1.SelectedItems.Value) || IsEmpty(ComboBox_nature_1.SelectedItems.Value) || Nature.Value= ComboBox_nature_1.Selected.Value;
 IsBlank(ComboBox_rsp_1.SelectedItems.Value) || IsEmpty(ComboBox_rsp_1.SelectedItems.Value) || Responsable_Stellanatis.Value = ComboBox_rsp_1.Selected.Value;
 IsBlank(ComboBox_anticipe.SelectedItems.Value) || IsEmpty(ComboBox_anticipe.SelectedItems.Value) || Anticipé.Value= ComboBox_anticipe.Selected.Value;
 IsBlank(ComboBox_statut_1.SelectedItems.Value) || IsEmpty(ComboBox_statut_1.SelectedItems.Value) || Statut.Value = ComboBox_statut_1.Selected.Value;
 IsBlank(ComboBox1_2.SelectedItems.Value) || IsEmpty(ComboBox1_2.SelectedItems.Value) || SemaineProgrammee in ComboBox1_2.SelectedItems ;
 StartsWith('Lien DocInfo Fr'; 'LienDoc Fr_1'.Text);
 StartsWith('Lien DocInfo EN'; LienDocAn_1.Text);
 StartsWith(Titre; Desciption_t_1.Text);
 StartsWith(SemaineProgrammee;SemaineP_1)
 
 );
 "Date0" ;
 SortOrder.Ascending 
 );
 If(
 !IsBlank(DatePicker1_1.SelectedDate) && !IsBlank(DatePicker1_7.SelectedDate);
 SortByColumns(
 Filter(
 test;
 ThisRecord.Date >= DatePicker1_1.SelectedDate &&
 ThisRecord.Date <= DatePicker1_7.SelectedDate &&
 IsBlank(ComboBox_Priorité_1.SelectedItems.Value) || IsEmpty(ComboBox_Priorité_1.SelectedItems.Value) || Priorité.Value = ComboBox_Priorité_1.Selected.Value;
 IsBlank(ComboBox_type_1.SelectedItems.Value) || IsEmpty(ComboBox_type_1.SelectedItems.Value) || TYPE.Value = ComboBox_type_1.Selected.Value;
 IsBlank(ComboBox_nature_1.SelectedItems.Value) || IsEmpty(ComboBox_nature_1.SelectedItems.Value) || Nature.Value= ComboBox_nature_1.Selected.Value;
 IsBlank(ComboBox_rsp_1.SelectedItems.Value) || IsEmpty(ComboBox_rsp_1.SelectedItems.Value) || Responsable_Stellanatis.Value = ComboBox_rsp_1.Selected.Value;
 IsBlank(ComboBox_anticipe.SelectedItems.Value) || IsEmpty(ComboBox_anticipe.SelectedItems.Value) || Anticipé.Value= ComboBox_anticipe.Selected.Value;
 IsBlank(ComboBox_statut_1.SelectedItems.Value) || IsEmpty(ComboBox_statut_1.SelectedItems.Value) || Statut.Value = ComboBox_statut_1.Selected.Value;
 IsBlank(ComboBox1_2.SelectedItems.Value) || IsEmpty(ComboBox1_2.SelectedItems.Value) || SemaineProgrammee in ComboBox1_2.SelectedItems ;
 StartsWith('Lien DocInfo Fr'; 'LienDoc Fr_1'.Text);
 StartsWith('Lien DocInfo EN'; LienDocAn_1.Text);
 StartsWith(Titre; Desciption_t_1.Text);
 StartsWith(SemaineProgrammee;SemaineP_1)
 );
 "Date0";
 SortOrder.Ascending
 );
 SortByColumns(
 Filter(
 test;
 //ThisRecord.Date = DatePicker1_1.SelectedDate;
 IsBlank(ComboBox_Priorité_1.SelectedItems.Value) || IsEmpty(ComboBox_Priorité_1.SelectedItems.Value) || Priorité.Value = ComboBox_Priorité_1.Selected.Value;
 IsBlank(ComboBox_type_1.SelectedItems.Value) || IsEmpty(ComboBox_type_1.SelectedItems.Value) || TYPE.Value = ComboBox_type_1.Selected.Value;
 IsBlank(ComboBox_nature_1.SelectedItems.Value) || IsEmpty(ComboBox_nature_1.SelectedItems.Value) || Nature.Value= ComboBox_nature_1.Selected.Value;
 IsBlank(ComboBox_rsp_1.SelectedItems.Value) || IsEmpty(ComboBox_rsp_1.SelectedItems.Value) || Responsable_Stellanatis.Value = ComboBox_rsp_1.Selected.Value;
 IsBlank(ComboBox_anticipe.SelectedItems.Value) || IsEmpty(ComboBox_anticipe.SelectedItems.Value) || Anticipé.Value= ComboBox_anticipe.Selected.Value;
 IsBlank(ComboBox_statut_1.SelectedItems.Value) || IsEmpty(ComboBox_statut_1.SelectedItems.Value) || Statut.Value = ComboBox_statut_1.Selected.Value;
 IsBlank(ComboBox1_2.SelectedItems.Value) || IsEmpty(ComboBox1_2.SelectedItems.Value) || SemaineProgrammee in ComboBox1_2.SelectedItems ;
 StartsWith('Lien DocInfo Fr'; 'LienDoc Fr_1'.Text);
 StartsWith('Lien DocInfo EN'; LienDocAn_1.Text);
 StartsWith(Titre; Desciption_t_1.Text); 
 StartsWith(SemaineProgrammee;SemaineP_1)
 );
 "Date0";
 SortOrder.Ascending
 )
)
)

i tried to add this code in sort 

 "Date0" || IsBlank(Label16_1.Text);
 SortOrder.Ascending 
 );

but they told me that u have a circulaire reference 

im Lost could u Help me PowerApps Community 

Best Regards Meryem_gz

Categories:
I have the same question (0)
  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @meryem_gz ,

     

    In Galleries' Items, you should Filter and Sort using Column Names rather than Control Names.

     

    On the other hand, to hide the rows but leave blank, you can add a rectangle into Gallery template and make it on top level, set its Visible property based on your need. For example, on my end I can hide the row where RC column equal to a specific number:

    vjefferni_1-1693365255548.png

    vjefferni_2-1693365296944.png

    vjefferni_0-1693365175740.png

     

    Best regards,

  • meryem_gz Profile Picture
    18 on at

    thank u for ur answer , for the first solution  i have 12 filters it depends on what the user gonne set to filter it that why i use Column name with control Names  for the second one  as u can see the yellow part are an invisible items because the week is blank for me i just want the condition stay but the invisible blanks should be in the bottom of the gallery if i use sort they are alreasy sorted by Date0 when i tried to use it both it doesnt work even just with column name 

     

    meryem_gz_0-1693387552298.png

     

  • Chris-D Profile Picture
    1,246 on at

    Hi Meryem,

     

    A circular reference means you have a formula which relies on another formula which relies on the first formula. You may see a circular reference error in Excel when you point 2 cells at each other. 

     

    There could be more than 2 properties involved in this circle. 

     

    Label16_1 is inside your gallery, so you can't sort the gallery by the value of that text because it doesn't know what that value is until your gallery is sorted. 

     

    To solve this, wrap the whole of your 'Items' code in another filter to filter out the blank data.

  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @meryem_gz ,

     

    I cannot clearly understand your sentences that having no separators. I see there are records with different Date values by which you are sorting, however, there is no way to sort same values in a specific order in PowerApps, there must be some additional values for sorting in the data source. If there isn't, the best approach I can think of is just filter unwanted records from the Gallery.

     

    Best regards,

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

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 352 Most Valuable Professional

#2
11manish Profile Picture

11manish 192

#3
Valantis Profile Picture

Valantis 128

Last 30 days Overall leaderboard