Hi I am trying to use the 'or' together with 'and' in an if statement but is it not returning the result I expected.
Basically I want to only enable a field called 'Policy Editor', when the UserEmail field is equal to the DocumentOwnerEmail field OR the LibrarianEmail field AND when the DocumentStatus field is equal to draft.
Using below formula only disables the Policy Editor field when both the DocumentOwnerEmail field and the LibrarianEmail field doesn't equal (contain)the UserEmail field.
If the UserEmail field is equal to one of the fields and the Document Status doesn't equal Draft, it is still enabled.
It appears the If statement is ignoring the And /Document status part.
I need the Policy editor field to disable even when the UserEmail field equals either DocumentOwnerEmail field or LibrarianEmail field And when the Document Status field doesn't equal draft.
My If statement:
If(UserEmail.Text in DocumentOwnerEmail.Text Or UserEmail.Text in LibrarianEmail.Text And ThisItem.DocumentStatus.Value="Draft",DisplayMode.Edit,DisplayMode.Disabled)