Question
You are customizing a model-driven app view that is used to manage contract approvals by using Power Fx.
A custom command button must appear only when:
• One or more records are selected in the grid view.
• All selected records have a RecordStatus field value of Ready.
You need to configure the command to meet the business requirements.
Which Power Fx expressions should you use? To answer, select the appropriate options in the answer area.
NOTE: Each correct selection is worth one point.
Explanation
At least one record is selected: CountRows(Self.Selected.AllItems) > 0. In a modern command's Visible formula, Self.Selected.AllItems is the table of rows selected in the grid. Counting it and requiring more than zero rows shows the button for any non-empty selection. CountRows(...) = 1 hides the button when two or more records are selected. !IsBlank(...) is unreliable because IsBlank does not test whether a table is empty (IsEmpty does), so an empty selection is not detected.
All selected records have a value of Ready: CountIf(Self.Selected.AllItems, RecordStatus <> "Ready") = 0. CountIf counts the selected rows whose RecordStatus is not Ready. The result is zero only when every selected row is Ready, which gives the Boolean that Visible needs. ForAll returns a table of results, not a single true/false value, so it cannot be used as the visibility condition. Self.RecordStatus = "Ready" refers to the command itself, not to the selected rows.