Skip to main content

Notifications

Power Apps - Building Power Apps
Suggested answer

Gallery not rendering the records based on user role which is set in app.onstart

(1) ShareShare
ReportReport
Posted on by 492
I have a powerapp gallery which should show the records based on user role which i check in app.onstart. However gallery is showing empty, even though there are records. May i know where i am going wrong?
 
App.Onstart
Set(
    var_superadmin,
    If(
        CountRows(
            Filter(
                User_Access_List,
                Title = "Admin" && User.Email in MyProfile.mail
            ).ID
        ) > 0,
        true,
        false
    )
);
Set(
    var_normaluser,
    If(
        CountRows(
            Filter(
                User_Access_List,
                Title = "Normal User" && User.Email = MyProfile.mail
            )
        ) > 0,
        true,
        false
    )
);
Set(
    var_cdguser,
    If(
        CountRows(
            Filter(
                User_Access_List,
                Title = "DG User" && User.Email in MyProfile.mail
            )
        ) > 0,
        true,
        false
    )
);
Gallery Items
With(
    {
        _Data: Filter(
            'Datasource',
            ID > 0 
        )
    },
    SortByColumns(
        Filter(
            _Data,
            var_normaluser && (User().Email in Team_Members.Email || 'Created By'.Email = User().Email || User().Email in 'Owner'.Email || User().Email in 'Manager'.Email || User().Email in 'Owner'.Email) && (Len(TextInputCanvas1.Value) = 0 || TextInputCanvas1.Value in Title || TextInputCanvas1.Value in 'Owner'.DisplayName || TextInputCanvas1.Value in 'Manager'.DisplayName) || (var_superadmin || var_cdguser) && (Len(TextInputCanvas1.Value) = 0 || TextInputCanvas1.Value in Title || TextInputCanvas1.Value in 'Owner'.DisplayName || TextInputCanvas1.Value in 'Manager'.DisplayName)
        ),
        varsortcolumn,
        varsortdirection
    )
)
 
Categories:
  • Iantaylor2050 Profile Picture
    Iantaylor2050 492 on at
    Gallery not rendering the records based on user role which is set in app.onstart
    Hi @WarrenBelz
     
    Could you please help me on the above issue? Its a different issue related to gallery
  • Suggested answer
    vipuljain03 Profile Picture
    vipuljain03 157 on at
    Gallery not rendering the records based on user role which is set in app.onstart

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,422

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,711

Leaderboard