
Announcements
Hi all,
Background info: based on the result of the variable value users can edit fields or not.
varLoggedinUser (this is set to the User() at OnStart
varRole (this is a lookup at Onstart
Status (this is a dropdown field if nothing is selected or if it is still Draft)
Currently I have the below formula in the DisplayMode option that I would like to simplify and store its result as a variable as it is very tiresome to apply this to specific fields especially when I need to combine it with additional criteria
If((SharePointIntegration.Selected.'Created By'.Email=varLoggedInUser.Email && (SharePointIntegration.Selected.Status.Value="Draft" || SharePointIntegration.Selected.Status.Value=Blank()) || varRole="Admin")
I tried to store this as a variable at OnStart but it just does not want to work:
Without the any additional criteria I tried to store it as varRequestor just to see if the user who opened the item is the creator:
If(SharePointIntegration.Selected.'Created By'.Email=User().Email,Set(varRequestor, true),Set(varRequestor,false))
This gives me totally inconsistent results.
Behavior:
1. User edits existing form – OnStart is triggered
2. User saves or cancels form
3. User opens new form - OnStart does not trigger – global variables are set to values from previous load
4. User saves or cancels form
5. User opens second existing item – OnStart does not trigger
Any suggestion how to check and store the created by in a variable? How do you usually do it? Just to determine who is admin in a list is not enough (I am using that method as well to lock permanently down other fields)