Good Afternoon All,
I use Edge in private mode to create Apps using Power Apps. First time PowerApp builder and poster. I am having a very odd issue. In my New Starter Power Apps Forum I have an objective to show certain cards properties as DisplayMode = view only or Visibility = false. This condition depends on the User().email that is detected whilst PowerApp is open. If the person logged into or using the App fall into a certain group they can only view certain Text inputs and other Text labels and Text inputs are hidden all together.
I have a SharePoint list called “New Starter Form Access". In the list it has three columns with three entries (rows).
* Title (Single line of text) description of the group
* Approval Level (Choice) selection of HR, Line Manager and IT
* Group (People or Group) selection of Office365 security groups for people. HR Line Manager and IT
The Power Apps form uses this SharePoint list as data connections.
In the Power Apps itself I have the App on Startup property use the following formula. The first three "Isdepartment" is the actual code I used. Me using powerapps and previewing the App should detect that I am part of IT. As a result the Lookup should return as false because I have a record email which matches User().email in "New Starter Form Access" list under the column "group" for group IT.
Set(currentUser, User());
Set(isIT , IsBlank(LookUp('New Starter Form Access', 'Group (Group0)'.Email = currentUser.Email && 'Approval Level'.Value = "IT" ))); //false
Set(isHR , IsBlank(LookUp('New Starter Form Access', 'Group (Group0)'.Email = currentUser.Email && 'Approval Level'.Value = "HR" ))); //true
Set(isLM , IsBlank(LookUp('New Starter Form Access', 'Group (Group0)'.Email = currentUser.Email && 'Approval Level'.Value = "Line Manager" ))); //true
This is another formula I had tried and had the same issue. It worked originally and then stopped after reloading the page / coming into work the next day / or after a couple of hours.
Set(VarLookupUser, IsBlank(LookUp('New Starter Form Access', 'Group (Group0)'.Email = User().Email))); // FALSE This is comparing any entries in SharePoint List group column to see if any email entries that equal currently logged in users Email. The IsBlank function tests for a blank value or an empty string returns boolean true or false. If I am logged into the PowerApps it should return false because I am listed in the Groups column for New Starter Form Access list so the returned value for IsBlank is false.
Then depending on the field
For Visibility property for datacards I have the following formula
isIT
For DisplayMode for datacards I have the following formula
If(!IsBlank(VarLookupUser),DisplayMode.View,DisplayMode.Edit)// IsBlank is false user can edit
To try and understand what was happening in the logic I created some validation fields in the form.
Display User.()email
Display if User.()email was the same as xxxx@xxx.com and out detected or not detected
Display The value of IsBlank for VarLookupUser
Display The value of IsBlank for IsHR
Display The value of IsBlank for IsLM
Display The value of IsBlank for IsIT
I had noticed when I first enter the formula's for OnStartup for App property the Value of the Variable's IsBlank is what I would expect
For Me it should
value of IsBlank for VarLookupUser = false
value of IsBlank for IsHR = true
value of IsBlank for IsLM = true
value of IsBlank for IsIT= false
As my email is in listed in IT Group for the SharePoint list for both IsIT and VarLookupUser.
However, they are all now showing as
value of IsBlank for VarLookupUser = true
value of IsBlank for IsHR = true
value of IsBlank for IsLM = true
value of IsBlank for IsIT= true
Meaning that its not detecting my users email when looking up in the SharePoint list. Its odd how it works the first time I code the formula then after certain time elapses or I reload the page It for myself IsBlank is being detected as true. Its also like the detection is not being run correctly / is cached or not able to find the entries. Any suggestion would be greatly appreciated.