Hi,
My app has 3 different user levels and I want to redirect them to the appropriate dashboard depending on their user role. We have created a splash screen with a 2 second timer that redirects based on a user role that is taken from a SharePoint list.
The user role code is on the app onStart and is as follows:
Set(
userRole,
LookUp(
'PA - User Roles',
Email = User().Email
).Role
);
The timer onTimerEnd code on the splash screen is below:
If(
IsBlank(userRole),
Navigate(
CustomerHome,
ScreenTransition.None
),
If(userRole.Value = "Customer", Navigate(CustomerHome, ScreenTransition.None),
If(userRole.Value = "Admin", Navigate(AdminDashboard, ScreenTransition.None),
Navigate(
CustomerHome,
ScreenTransition.None
)
/*,
"Supplier",
Navigate(SupplierHome, ScreenTransition.None) */
)
))
Everything works correctly when in designer, but when we publish the app, it freezes on the splashscreen. We have tried moving the set user role code to the splashscreen onVisible but doesn't work either. We have also tried increasing the timer duration.
Any help would be greatly appreciated