If you ever wondered how to setup a quick and easy form on SharePoint Online List to validate the columns based on specific conditions, you came to the right place!
In SharePoint, by default you can do simple column validations by using formulas in the validation settings in a list. But if you need more advanced conditions, you can also use Power Apps.
In this blog, we will go over on how to create a simple yet effective dynamic conditional SharePoint List column validation with the power of Power Apps (pun intended).
This app will enforce user to provide Team Name, Reason and Team Site Url when Submit for Approval is set to yes/true. Otherwise, it will be optional fields by default.
To start, create your SharePoint Online List if you have not already and then follow these steps:
- On the list, click on Integrate button then select Power Apps and Customize forms
- You will then be navigated to Power Apps portal with the form opened up
- This is where the fun parts begin. Select the DataCard that you want to create a validation, in this case it will be Team Name, Team Site Url and Reason
- On the right side, click on Advanced and hit Unlock to change properties. (You need to do this for all the columns you want to validate)
- Select the DataCard again for one of the columns, and change the property to Required
- On the formula bar, type If(DataCardValue4.Value, true, false). Your DataCardValue4 name might be different
- What this means is if DataCardValue4’s value (the toggle for Submit for Approval) is true, the Reason column will require input before it is saved
- Repeat step 5 and 6 for all the columns you want to validate against
- Once done, you can verify by toggling Submit for Approval button and see the asterisks beside each field appear and disappear depending on if Submit for Approval is true or false
- Click on File > Save > Publish to SharePoint to publish it and make it live – that’s it! You can go back to the list by clicking on Back to SharePoint on the top corner
- Now, if you select an item on your list and click on Edit button, you will notice if you toggle Submit for Approval to true, the columns that you inserted the formula to now becomes a require column
You can customize the Form to be more complex and make changes to fit your needs.
This hopefully gives you an idea the things you can do with Power Apps on SharePoint Online Lists.
Posted by: Edward Chen & Noorez Khamis.
Have any questions?
We’re happy to help. Don’t hesitate to email email@example.com for more information on this topic.