I often use this pattern:
RunActions(
[Table].AddRow(),
[Table 2].Filter([Selected?]).ModifyRows([Associated], [Table].Last())
)
But I’m worried about race conditions.
What I’m trying to do is this:
RunActions(,
[Table 2].Filter([Selected?]).ModifyRows([Associated], [Table].AddRow())
)
I.e. add a row to [Table] and associate it with [Table 2]. I can’t do this because sometimes it returns an Action instead of a Row. I’ve been told not to take that approach.
However, I have a concern with the [Table].Last()
approach.
Is it possible that someone else could add a new row at just the right time while my button is executing and I could accidentally grab the wrong row when I call Last()
?
@Jono_Bouwmeester @BenLee @Bill_French @Nina_Ledid do you know the answer to this?
One possible way to test:
RunActions(
[Table].AddRow([Name], "Correct"),
_Delay(true, 100000),
[Table 2].Filter([Selected?]).ModifyRows([Associated], [Table].Last())
)
then a different user clicks a button with
[Table].AddRow([Name], "Incorrect")
If “Incorrect” ever showed up in [Table] we would have the risk of a race condition