cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Imade
Helper I
Helper I

Display Gallery missing

Hello,

 

I have a problem with my gallery.

 

I didn't make any changes to my application and now the content of my gallery has disappeared from an iPhone or Android.
It is still visible in preview from powerapps.

 

Items property:

If(
    Len(SearchBox.Text) > 1;
    SortByColumns(
        Filter(
            'Fiches Litiges';
            'Créé par'.Email = User().Email || 'Nom chauffeur'.Email = User().Email;
            SearchBox.Text in 'Nom du produit' || SearchBox.Text in 'Nom du Client' || SearchBox.Text in 'Créé par'.DisplayName
        );
        "Modified";
        SortOrder.Descending
    );
    SortByColumns(
        Filter(
            'Fiches Litiges';
            'Créé par'.Email = User().Email || 'Nom chauffeur'.Email = User().Email
        );
        "Modified";
        SortOrder.Descending
    )
)

The property of:
visible --> is true

DisplayMode --> DisplayMode.Edit

 

Imade_0-1612892064402.pngImade_1-1612892260652.png

 

 

Could you please help me

 

Thank you in advance

Best Regards

 

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
RandyHayes
Super User
Super User

@Imade 

Sorry, had an extra semi-colon in the formula...should be this:

With({_user: User()};
    SortByColumns(
        Filter(
            'Fiches Litiges';
            ('Créé par'.Email = _user.Email || 'Nom chauffeur'.Email = _user.Email) &&
            (IsBlank(SearchBox.Text) || SearchBox.Text in 'Nom du produit' || SearchBox.Text in 'Nom du Client' || SearchBox.Text in 'Créé par'.DisplayName)
        );
        "Modified";
        SortOrder.Descending
    )
)

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

RandyHayes
Super User
Super User

@Imade 

Mobile devices are picky because they work from a different set of player code bases.  Some things cause issues.

 

You say you put a new Gallery in and set to just the datasource and it showed up.

If you put the formula I provided into that new gallery, did it disappear on the phone?

If so, then let's pull the User evaluation out of the Items.  This is one of the sources of issues on devices.

 

In your OnStart of the app, put the following line of formula:

Set(glbUser, User());

 

Now, change the Gallery formula to the following:

SortByColumns(
    Filter(
        'Fiches Litiges';
        ('Créé par'.Email = glbUser.Email || 'Nom chauffeur'.Email = glbUser.Email) &&
        (IsBlank(SearchBox.Text) || SearchBox.Text in 'Nom du produit' || SearchBox.Text in 'Nom du Client' || SearchBox.Text in 'Créé par'.DisplayName)
    );
    "Modified";
    SortOrder.Descending
)

 

If that provides no joy, then start tearing the formula apart.

 

First try the following:

Filter(
    'Fiches Litiges';
    ('Créé par'.Email = glbUser.Email || 'Nom chauffeur'.Email = glbUser.Email) &&
    (IsBlank(SearchBox.Text) || SearchBox.Text in 'Nom du produit' || SearchBox.Text in 'Nom du Client' || SearchBox.Text in 'Créé par'.DisplayName)
)

Working?  Then there is an issue with date formatting and sorting.

 

No difference?  Then try this:

SortByColumns(
    Filter(
        'Fiches Litiges';
        (IsBlank(SearchBox.Text) || SearchBox.Text in 'Nom du produit' || SearchBox.Text in 'Nom du Client' || SearchBox.Text in 'Créé par'.DisplayName)
    );
    "Modified";
    SortOrder.Descending
)

Working? Then there is an issue with the email filtering.

 

Beyond that, you'd be pretty much back to the datasource as your next step - which we know already works.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

7 REPLIES 7
RandyHayes
Super User
Super User

@Imade 

The User() function inside of your Formulas sometimes causes issues on different devices.

Please consider changing your Formula to the following:

With({_user: User()};
    SortByColumns(
        Filter(
            'Fiches Litiges';
            ('Créé par'.Email = _user.Email || 'Nom chauffeur'.Email = _user.Email) &&
            (IsBlank(SearchBox.Text) || SearchBox.Text in 'Nom du produit' || SearchBox.Text in 'Nom du Client' || SearchBox.Text in 'Créé par'.DisplayName)
        );
        "Modified";
        SortOrder.Descending
    );
)

Note: the above combines the if condition you were using before - in general it is bad practice to have multiple Filter statements in a formula based on If logic (for maintainability and record schema potential issues).  The above is equivalent to what you had before.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Hello @RandyHayes ,

Thank you for this formule but i tried and i have an error :

Imade_0-1612898146123.png

 

I will do differently for my if condition thank you for the information


Thank you in advance

RandyHayes
Super User
Super User

@Imade 

Sorry, had an extra semi-colon in the formula...should be this:

With({_user: User()};
    SortByColumns(
        Filter(
            'Fiches Litiges';
            ('Créé par'.Email = _user.Email || 'Nom chauffeur'.Email = _user.Email) &&
            (IsBlank(SearchBox.Text) || SearchBox.Text in 'Nom du produit' || SearchBox.Text in 'Nom du Client' || SearchBox.Text in 'Créé par'.DisplayName)
        );
        "Modified";
        SortOrder.Descending
    )
)

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

@RandyHayes ,

I'm sorry but I put your formula and it still doesn't work from an iPhone or Android nothing is displayed 😞

its work only on previews of powerapps.
When i insert a new Gallery with a default value (name of my liste sharepoint) in Items i can the see the Gallery

RandyHayes
Super User
Super User

@Imade 

Mobile devices are picky because they work from a different set of player code bases.  Some things cause issues.

 

You say you put a new Gallery in and set to just the datasource and it showed up.

If you put the formula I provided into that new gallery, did it disappear on the phone?

If so, then let's pull the User evaluation out of the Items.  This is one of the sources of issues on devices.

 

In your OnStart of the app, put the following line of formula:

Set(glbUser, User());

 

Now, change the Gallery formula to the following:

SortByColumns(
    Filter(
        'Fiches Litiges';
        ('Créé par'.Email = glbUser.Email || 'Nom chauffeur'.Email = glbUser.Email) &&
        (IsBlank(SearchBox.Text) || SearchBox.Text in 'Nom du produit' || SearchBox.Text in 'Nom du Client' || SearchBox.Text in 'Créé par'.DisplayName)
    );
    "Modified";
    SortOrder.Descending
)

 

If that provides no joy, then start tearing the formula apart.

 

First try the following:

Filter(
    'Fiches Litiges';
    ('Créé par'.Email = glbUser.Email || 'Nom chauffeur'.Email = glbUser.Email) &&
    (IsBlank(SearchBox.Text) || SearchBox.Text in 'Nom du produit' || SearchBox.Text in 'Nom du Client' || SearchBox.Text in 'Créé par'.DisplayName)
)

Working?  Then there is an issue with date formatting and sorting.

 

No difference?  Then try this:

SortByColumns(
    Filter(
        'Fiches Litiges';
        (IsBlank(SearchBox.Text) || SearchBox.Text in 'Nom du produit' || SearchBox.Text in 'Nom du Client' || SearchBox.Text in 'Créé par'.DisplayName)
    );
    "Modified";
    SortOrder.Descending
)

Working? Then there is an issue with the email filtering.

 

Beyond that, you'd be pretty much back to the datasource as your next step - which we know already works.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

@RandyHayes ,

 

The last formula working... so the problem came from the filtering "create by"

So I went to the sharepoint list and I saw all my registrations on the sharepoint list has been deleted by my colleague... hence the invisibility of my requests. (I don't use the same account for the creation of app)

 

I have nevertheless put your formula which is more adapted for my application.

 

Sorry to have bothered you and thank you again !

 

 

 

RandyHayes
Super User
Super User

@Imade 

It's always the last thing you look at 😁  Glad you discovered the issue and more than happy to help - no bother at all.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Helpful resources

Announcements
User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,495)