Feb 03 2023 02:59 PM - edited Feb 03 2023 03:00 PM
I am trying to hide some items on a form based upon the current user. The scenario is that a user will submit a request to a SharePoint list using the Newform. The form has multiple fields, but 4 of them include the hiring manager and 3 approvers for the request. If the current user is the manager or one of the approvers, then certain items will be visible/editable on Edit and display screens. Otherwise they will be hidden. I have set this in the app OnStart:
Set(ThisUser, User().FullName)
For the fields to be made visible, I have added this to the fields' Visible property:
ThisUser = 'Hiring Manager'.Text || ThisUser = 'Approver1'.Text || ThisUser = 'Approver2'.Text || ThisUser = 'Approver3'.Text
This always fails, even though this works:
ThisUser = 'Hiring Manager'.Text
All 4 fields in the list have the data type of person or group, so I cannot understand why Hiring Manager alone works, but the other fields fail.
The options when selecting the approver do not include text or value.
Thanks for any insight on this problem.