Hi Forum,
i want to check is a field in my collection empty or not.
If a specific field emty, i want to disable a button
Example for a button diplaymode property:
If(IsBlank(collection.field);DisplayMode.Disabled;DisplayMode.Edit)
This is not working, anyone know another way?
Thanks & greets
Solved! Go to Solution.
The problem is that you can't check whether a collection field is empty, you have to check whether a field is empty for a record in a collection. Even if there is only one record you have to reference the record to get the field value. So assuming you only have one record in the collection then the formula you need is:
If(IsBlank(First(mycollection).test),DisplayMode.Disabled,DisplayMode.Edit)
If you have more than one record you have to do something to get the specific record and then check the field in the record.
The problem is that you can't check whether a collection field is empty, you have to check whether a field is empty for a record in a collection. Even if there is only one record you have to reference the record to get the field value. So assuming you only have one record in the collection then the formula you need is:
If(IsBlank(First(mycollection).test),DisplayMode.Disabled,DisplayMode.Edit)
If you have more than one record you have to do something to get the specific record and then check the field in the record.
Here is a method I successfully use to determine if a particular column within a Collection contains blank values or not:
Filter(colTest, IsBlank(columnName))
You can do things like this to check multiple columns for blanks:
If(
CountRows(
Filter(colTest,
Or(
IsBlank(columnName1),
IsBlank(columnName2),
IsBlank(columnName3)
)
)
) > 0,
"x",
"y"
)
Hope this helps!
You could filter the gallery by all the records that are blank in this collection and then count the rows. If the result is bigger than 1, the button should be disabled.
example for the statement: CountRows(Filter(colMyCollection, IsBlank(colMyCollection[@MyField]))) > 0
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Power Platform release plan for the 2022 release wave 2 describes all new features releasing from October 2022 through March 2023.
User | Count |
---|---|
205 | |
97 | |
60 | |
51 | |
45 |
User | Count |
---|---|
257 | |
158 | |
85 | |
79 | |
58 |