I have a PowerApps that checks if a field is blank:
If( Sum( ExpenseCollection, LineCost ) = 0 || (IsBlank(DataCardValue57) || IsBlank(DataCardValue59) || IsBlank(DataCardValue60) || IsBlank(DataCardValue64) || IsBlank(DataCardValue63) || IsBlank(DataCardValue65) || IsBlank(DataCardValue66) || IsBlank(DataCardValue67)), false, true )
One of these fields is the one below, which checks that if it's empty, the Submit icon should not be open. When I test the first time, the conditional statement is working. However, when I remove one of the required fields, the submit icon gets visible (see below):
These are the required fields:
Hope anyone can help.
IsBlank checks whether its parameter is null / blank - which is not the case for a control (DataCardValueXX). For the combo box controls that I think you're using, you can use their SelectedItems property to see how many items are selected (using the CountRows function), like in the example below:
If( Sum( ExpenseCollection, LineCost ) = 0 || Coalesce(CountRows(DataCardValue57.SelectedItems), 0) = 0 || Coalesce(CountRows(DataCardValue59.SelectedItems), 0) = 0) || ... Coalesce(CountRows(DataCardValue67.SelectedItems), 0) = 0), false, true )
If the combo box doesn't have any item selected, its SelectedItems property may return either a blank value, or an empty table, which is why the example above uses the Coalesce function to account for both cases.
I believe the fact that the combo box doesn't return an empty table (returning a blank result instead) is a bug (see screen capture below) that we can workaround by wrapping the CountRows in the Coalesce call to handle the blank case - I've notified the team responsible for that control to get it fixed.
For lookup columns, I'm not sure if it has the same behavior, but you can test it out in your app without the Coalesce function. If it works fine, then you don't need it.
Check out new user group experience and if you are a leader please create your group
Did you know that you can visit the Power Query Forum in Power BI and now Power Apps
Participate in the Power Virtual Agents Community Challenge
Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.