上QQ阅读APP看书,第一时间看更新
Customizing forms
As well as creating fully functioning apps based on SharePoint data, PowerApps can also be used to customize specific list form experiences such as being able to create a customized new form or a customized edit form. This is so that you can build much more functionality into the form itself, for example, showing and hiding specific fields based on an input elsewhere.
Consider using this if you want to add more styling to your SharePoint list form as you will be able to use icons and geometric shapes to add more character to your form.
To create our customized list form, we will start in the same way as we did previously:
- Simply navigate to your list with SharePoint using a browser.
- On the list actions running across the top of the list, click on the drop-down menu titled PowerApps; however, this time, select Customize forms, as seen in Figure 3.9: The PowerApps menu showing the Customize forms option.
- If you can't see this menu, then it is likely that you have a list item selected, indicated by a tick against a row.
- Simply deselect that list item, and the list menu will return:
Figure 3.9: The PowerApps menu showing the Customize forms option
- Again, PowerApps Studio will launch in a new tab so that you can customize the app; however, there are some key differences. Firstly, you will notice that there is a navigation link above the normal menu allowing you to navigate Back to SharePoint. This will close the app for you and return you to your list.
- Secondly, below the usual app object under screens, there is now an additional item called SharePointIntegration, as illustrated in Figure 3.10: The SharePointIntegration properties. Notice that there are also multiple events that you can build functionality around, such as OnView, OnSave, OnCancel, and more:
Figure 3.10: The SharePointIntegration properties
SharePointIntegration is designed to set the global SharePoint settings for this particular app, in a similar way that app allows global settings for the app as a whole. This option will only appear when customizing a form from SharePoint; it won't appear if you are simply using SharePoint as a data source like we did earlier in this chapter when we created the auto-generated app.
Now that we have looked at how we can create the customized form, we need to modify the form to make it bespoke to our needs.