Skip to main content

Notifications

Power Apps - Building Power Apps
Suggested answer

unwanted items are displayed in my gallery

Posted on by 687
Hello, I am trying to make a filter formula on my gallery, but unwanted items are displayed in my gallery. I do not understand why these unwanted items are displayed because they do not meet my condition.
Can you help me please? Thanks in advance!
 
My formula : 
 
 
 
 
unwanted items  :
 
 
  • ronaldwalcott Profile Picture
    ronaldwalcott 1,034 on at
    unwanted items are displayed in my gallery
    You probably need to remove the time component from your dates if you are comparing with Today.
    Also does your first condition check if the record is between today and 60 days from today or the record is before today? Is this what you mean to check?
    Wouldn't this condition actually select all records that are not greater than 60 days from today?  
  • Suggested answer
    unwanted items are displayed in my gallery
    Hi, I´m Alex.

    I understant that you need, one way that you can try to solve our problem do it one part at a time.

    1º - Create a collect with all items for 2 expressions the filter
     
    ClearCollect(
        col_all_items;
        Filter(
        'Affectations';
        'Date de retour prévisionnelle' >= Today() && 'Date de retour prévisionnelle' <= DateAdd(Today); 60; TimeUnit.Days
            )
        )
    Obs: For the test1, check the collect col_all_items to show the correct data
     
    2º - If the data are correct add another filter expressions
     
    ClearCollect(
        col_all_items;
        Filter(
        'Affectations';
        ('Date de retour prévisionnelle' >= Today() && 'Date de retour prévisionnelle' <= DateAdd(Today); 60; TimeUnit.Days) || 'Date de retour prévisionnelle' >= Today()
            )
        )
    Obs: For the test2, check the collect col_all_items to show the correct data

    3º - If the result are correct add another filter expressions
     
    ClearCollect(
        col_all_items;
        Filter(
        'Affectations';
        ('Date de retour prévisionnelle' >= Today() && 'Date de retour prévisionnelle' <= DateAdd(Today); 60; TimeUnit.Days) || 'Date de retour prévisionnelle' >= Today() || LookUp(your_table;Immatriculation.Id = Immatriculation.id && Kilométrage >= 2000; true)
            )
        )
     
    Obs: For the test3, check the collect col_all_items to show the correct data
     
    If the result of col_all_itens are correct, you can modify in your code. 
     
    Obs: I can´t understant your express
     
    LookUp(your_table;Immatriculation.Id = Immatriculation.id && Kilométrage >= 2000; true) but the result of lookup could be used to compare >=2000
     
    I hope that you solve your problem.
     
    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

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,517

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 64,037

Leaderboard