I am using sharepoint 2013. At one list I have implemented my custom edit page in infopath. I am using some sections and some rules. I would like to set a people picker field to readonly but I cannot find it!! On a normal textbox there is an option to set it on readonly. Can somebody please help to set this people picker to readonly?
5 Answers
I dont think its possible to do it, but the following would be the work around.
Add a “People Picker” to the Form;
Add a “Text Box” control to the Form, and set its properties as following:
a. Default Value: AccountId. (you specify the default value to the People picker field)
b. Refresh value when formula is recalculated : checked.
c. Display: Read-only. (Make it read-only, so that the user cannot change its value by UI )
Add Rule to the “Text Box” control. When “This field changes”, do “set a field’s value ”, or submit data.
REF: People Picker
Hope this helps you.
-
InfoPath is telling me that a textbox can't have the value of a person or group. Is there another workaround for this? Commented Oct 24, 2016 at 17:22
We can set the People picker control in read only mode using the below steps
It doesn't make sense to show people picker as read-only, instead you should show a read-only textbox with User Name or Login Name!
PS: Some controls, such as the Person/Group picker, don’t have a read-only toggle in their control properties. However, setting the View to read-only will work for these controls
You can use a Calculated field and set the value equals to your people picker field. Make sure the Calculated field value is updated every time. This Calculated field will always be 'Read Only'
I solved this by dragging in the display field from the people picker (DisplayName) into my form, which generated a "Repeating Section" in my form with a text box control that I could set to disabled using a rule.
I'm using a separate view for approvals; the people picker is only applicable when the form is initially submitted, so this may not apply to all cases.
Here's how I did it:
- Deleted the people picker control from my "Approvals" view (which was a copy of the default "Edit" view)
- In the Fields pane, switched to the "advanced view"
- Expanded the people picker field and found the the "DisplayNames" field:
- Drug the field into the form, which created a "Repeating Section" and a text box:
- Formatted the repeating section to what I liked and set a conditional formatting rule on the text box, which allows you to set the "Disable this control" for the people picker value!
I would post more images for the walkthrough, but do not have the reputation yet.