Implementing a required field validation is the way to force encourage a system user to enter the information which is critical for your business.
There are some options below to support this in PowerApps:
1. Too Easy and too obvious. App level validation.
It’s a Card property on the Edit form. Select the card you want to make required. Unlock the card. Change the property from “false” to “true”.
It’s good because it’s easy. However, it only allows you to set it required for the particular app, let’s call it app level validation. Which is a valid scenario.
If you need to set it for all apps working with your CDS data source, you have to do it differently.
2. The Required field in a CDS data source. Data source level validation.
Let’s make a Job Title field mandatory/required on a data source level.
From the top menu click on File then on the left-hand side click on Connections. Then select Data and Entities under Data.
Pick up the entity you are working with in your app. In my case it’s a Contact entity.
Click on the Contact entity then on the Fields tab then select the Job Title field from the list of fields.
Tick the Required property on the right panel. Done.
Then Save Entity.
Go back to the app. After refreshing the screen, I still didn’t see any magic happening, so I had to re-add the card to the form.
On the right-side Properties tab click on the X selected link for Fields.
Unselect the Job Title field then select it again.
The result in Edit mode:
The result after run:
Note: The validation message doesn’t need to be that ugly. You can always style it your way.
To be continued…