Ah ! It’s the Disable if
formula in the button .
I’ve prepared another sample as you’ve added some useful context here (compared to what you said in your other posts, at that time, it seemed like the notes where the important part so I’ve used this as the main thing the button should look at, but if in fact the important part are the dates and times, that’s will work too ) but I’m going to begin with the Disable if
part .
The formula I used in the button (see sample below ) is this one :
[Notes 3].Filter([Date & Time]="").Count()=[Notes 3].Count()
And what it does is :
- Count how many rows in the table
[Notes 3]
in the field Date & Time
are Blank
[Notes 3].Filter([Date & Time]="").Count()
- Count how many rows there are in the table
[Notes 3]
[Notes 3].Count()
And then, if the Count()
for the Blank
rows in Date & Time
is equal to the total number of rows in the table [Notes 3]
, the button gets disable (because it means that all the rows (at least in the Date & Time
field) in the table are empty. If it’s not the case and they are different (!=
), it means there’s at the very least one row with a Date & Time
.
Now, if you’re sure the Dates & Times
are the important values here (compared to the notes) following one of the examples I’ve shared above, here’s now the Action
formula of the button :
[Notes 3].Filter([Date & Time]!="").FormulaMap(RunActions(AddRow([Notes 3 - Archives],[Notes 3 - Archives].[Date & Time],CurrentValue.[Date & Time],[Notes 3 - Archives].[Stock Symbols],CurrentValue.[Stock Symbols],[Notes 3 - Archives].Notes,CurrentValue.Notes),ModifyRows(CurrentValue,[Date & Time],"",Notes,"")))
In short, the button does 2 things (that’s why I used RunActions()
) :
- Copy the appropriate rows from the table
[Notes 3]
in the table [Notes 3 - Archives]
(AddRow()
)
- Clear the
Date & Time
values and the Notes
for the rows it just copied (ModifyRows()
)
Now, for the longer version :
First the button needs to know which rows it should used to do what it has to do , in this case the rows where Date & Time
are not blank.
[Notes 3].Filter([Date & Time]!="")
Now that it knows which rows to use, it does this :
[...] FormulaMap(RunActions(AddRow([Notes 3 - Archives],[Notes 3 - Archives].[Date & Time],CurrentValue.[Date & Time],[Notes 3 - Archives].[Stock Symbols],CurrentValue.[Stock Symbols],[Notes 3 - Archives].Notes,CurrentValue.Notes) [...]
In other words :
For each (FormulaMap()
) rows in the list of all rows where the Date & Time
are not blank (CurrentValue
) add a row in the table [Notes 3 - Archives]
with those values :
- For the field
[Notes 3 - Archives].[Date & Time]
CurrentValue.[Date & Time]
The current value of the field Date & Time
for that specific row
- For the field
[Notes 3 - Archives].[Stock Symbols]
CurrentValue.[Stock Symbols]
The current value of the field Stock Symbol
for that specific row
- For the field
[Notes 3 - Archives].Notes
CurrentValue.Notes
The current value of the field Notes
for that specific row
After that, the button does this :
[...] ModifyRows(CurrentValue,[Date & Time],"",Notes,"") [...]
and in others words :
Still for for each rows (as it’s still in FormulaMap()
) in the list of all rows where the Date & Time
are not blank (CurrentValue
) modify the value for the Date & Time
field and put it as Blank
(""
) and modify the value for the Date & Time
field and put it as Blank
(""
) too .
And that’s it I think .
Hope this helps