I have an InfoPath form. I want to hide a field the first time a form is submitted, and for next step, make it visible for supervisor to edit the field and add more data to the form . How can i do this process using InfoPath or a SharePoint form?
-
How do you identify the supervisor for the item? Is he listed in a peoplepicker?– ChristofferAug 25, 2016 at 7:39
-
when new item created it will directly assign to supervisor– Mohammed Abdul MuqeetAug 25, 2016 at 12:12
-
So you will have the supervisor in a Peoplepicker/assigned to field?– ChristofferAug 25, 2016 at 13:19
-
There is only one user as supervisor it is fixed– Mohammed Abdul MuqeetAug 25, 2016 at 20:31
2 Answers
Create a hidden textbox on the form and set value 0 on Page Load. Create rules to hide the field when the textbox value is 0. While the form is opened for editing set the hidden textbox value to 1.
If you have a people picker field where the supervisor is provided, you can use sections in Infopath.
They are available from the Control section.
Add a section and put all the fields that the supervisor are supposed to see inside it. You can then apply a formatting rule to hide the section if the current user that open the form DOES NOT CONTAIN (equal/not equal does not work when comparing usernames.) the supervisors username provided in the people picker field / assigned to field.
Remember that a user still can create a view to see all the columns in a list, so you want to prevent them from creating a view to access the data.
The forms display like this for anyone that is not assigned to the people picker. And for anyone assigned to the peoplepicker field.
Apologies for the crappy paint pictures.