Can I use Modifyrows() with an if() statement in the value to be modified? Can't get it to work

Hey Steve!

Looks like the ModifyRows action does not evaluate new column values on per-row basis. You need to split your action in two: check the checkbox on the rows where it needs to be checked, and uncheck on those that need to be unchecked.

Here’s a formula for the “Set” button in the answer above; no need for hidden buttons.

RunActions(
  ModifyRows([Table 1].Filter(Checkbox.Not() AND Value = Input_Colour), Checkbox, true),
  ModifyRows([Table 1].Filter(Checkbox AND Value != Input_Colour), Checkbox, false)
)

Generally if you needed to modify each row with individual values based on row data, you’d have to make that button column and press them all individually via RunActions(). But in your case of true and false this isn’t necessary.

3 Likes