- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Printer Friendly Page
Do you have fields that need to be required? Unfortunately, Power Apps does not currently provide the ability to set a control as required and set rules around it. All hope is not lost, however, look no further……
We can implement a clever workaround using star icons and the DisplayMode and Visible properties.
The first step in this process is to determine which conditions are needed for the field to be required. Is it always required or are there a set of conditions, such as values in other fields, that make it required? Write them down so you don’t miss any.
Add a star icon for each field that is required and position it to the left or right of the required field.
- Height: 10
- Width: 10
- Color: Red
In the ‘Visible’ property of the icon set your conditions. Simple conditions that return a Boolean (true/false) value can be added without using an If statement.
Example: IsBlank(SomeField) or IsBlank(SomeField) && SomeField.Selected = “Value”
Conditions that do not return a true/false value need to be wrapped in an If statement.
Example: If(
CountRows(
Filter(DataSource, SomeColumn = “SomeValue”) ) =0,
true,
false
)
Now you can use the Visible property of your star icons to control what the user can do next. By using the DisplayMode and Visible properties of your controls you can prevent them from being selected until the user has filled out the required field(s). Using the DisplayMode property allows the control to remain visible but keeps it from being used, while the Visible property hides the control completely.
DisplayMode Example: If(
StarIcon.Visible,
DisplayMode.Disabled,
DisplayMode.Edit
)
Visible Example: !StarIcon1.Visible Or
!StarIcon2.Visible Or
!StarIcon3.Visible
These basic principles can be used to control the visibility to see and interact with other controls as well, such as warning labels etc.
- LenC on: Exploring Access Management using Power Automate F...
- powerappnewbie4 on: Securing Attachment Control in Power Apps: Validat...
- ramanujama on: Implementing Offline Capability in Power Apps
- AndyHoll on: Convert Office Files to PDF in Power Apps
- AndyHoll on: Embedding Office Files as PDFs
- allamram on: CICD using Deployment Pipelines in Power Platform
- hemomsusubodh on: Running Stored Procedures directly with PowerFX
- powerappnewbie4 on: How To count rows for gallery with more than 100 r...
- jela on: Multilingual support in Canvas Apps Using Microsof...
- Poweruser1211 on: ADVANTAGES AND DISADVANTAGES OF USING POWER FX TO ...