cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Meshal-Alsabi
Regular Visitor

problem with starting the app

hello,

 

when I start the app as a regular user the gallery it won't show any data but when I go to the Edit page it shows 

 

 the app version is the latest and I don't know why 

 

I provided screenshots one is for the start the app and the other one in the Edit application mode 

5 REPLIES 5
zmansuri
Super User
Super User

a.jpg

Make sure it's not like this.

 

Also post your gallery item code and your App.OnStart code

I checked and the last version is the live version.

 

and I post the code in the App.OnStart and the result is the same, I forgot to mention that I have roles for different users and only one role is not working in the play, the other roles is working perfectly  

What i meant was share your app.onstart and gallery item code here.

oh ok,

App.OnStart code:

Set(var2, Office365Users.MyProfileV2().mail);
Set(var1, LookUp('App Users', User.Email=var2));
Set(varRole, var1.Role.Value);

Switch(
varRole,
"SA",
Set(
varList,
Filter(
'Invoice()',
Creator.DisplayName = User().FullName
)
),
"AR",
Set(
varList,
Filter(
'Invoice()',
'Assign to:Email'.Value = Office365Users.MyProfileV2().mail
)
),
"Translator",
Set(
varList,
Filter(
'Invoice()',
'Translation Status'.Value = "Needs translation" || 'Translation Status'.Value = "Translated"
)
),
"Manager",
Set(
varList,
Filter(
'Invoice()',
'Invoice Status'<> "Invoice Paid"
)
),
Set(
varList,
'Invoice()'
)
);

this is to get what is the user's Role and set the table for the gallery  

 

Gallery item code :

 //For Sorting button
SortByColumns(
// Search Bar
Search(
Filter(
varList,
IsBlank(cbName.SelectedItems.'Customer Name') || IsEmpty(cbName.SelectedItems.'Customer Name') || 'Customer Name' in cbName.SelectedItems,
IsBlank(cbMaster.SelectedItems.'Master Project') || IsEmpty(cbMaster.SelectedItems.'Master Project') || 'Master Project' in cbMaster.SelectedItems,
IsBlank(cbStatus.SelectedItems) || IsEmpty(cbStatus.SelectedItems) || 'Invoice Status' in cbStatus.SelectedItems,
IsBlank(cbGroup.SelectedItems.Value) || IsEmpty(cbGroup.SelectedItems.Value) || 'Customer Group' in cbGroup.SelectedItems
),
TextSearchBox.Text,
"InvoiceNumber"
),
"BillingDate",
varSort
);

this gallery have filter, search, and sorting

Set(var2, Office365Users.MyProfileV2().mail);
Set(var1, LookUp('App Users', User.Email=var2));

 

MyProfileV2().mail and User.Email are the same thing. To get the role you need Email column from list 'App Users'.

For eg.

Set(varRole,LookUp('App User',Lower(EmailColumn) = Lower(User.Email)).Role)

the above line will add the role into variable. and only the role nothing else. Then you can use that variable in Switch statement.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

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