We have a customized InfoPath form for a SharePoint List with the “Request Number” field, which gets updated by an event receiver (or workflows sometimes) on Item created event. So, we wanted to hide the “Request Number” field from New Form.
At a high level, insert a “section” control and move the field you want to hide inside to it. Add a formatting rule to hide that section with the condition “ID is blank”! ID will be always blank on new forms!
Important: You need to have InfoPath Designer installed in your client machine!
Hide Fields in New Form of the InfoPath-SharePoint List form:
Here is how to hide a field in NewForm, step by step:
- Navigate to your SharePoint list, Click on Customize Form from the List Tab. (Or you can open InfoPath Designer, New >> SharePoint List >> Design Form >> Provide the URL of SharePoint site , and run through the wizard)
- Insert a New row to the appropriate place in the form. In Home >> Click on Section control under Controls Group.
- Cut and paste the fields you want to hide in New Form to the “Section” control.
- Select the “Section” control >> Click on Manage Rules button from the ribbon >> Click on New, Provide a Name to it.
- In Condition, Set: ID is Blank
- Under Rule type, Select Formatting, and the tick the Hide this control check box.
- Save and publish your InfoPath form.
Alternate approach: You can also create a new “View” for “NewItem” in the InfoPath form with fields you want to show and then Customize List >> Form Web Parts >> Edit the form web part in NewForm page, and then select the default view in the properties.