I have a fairly specific goal:
From a button in table 1: create and activate a row in a table 2, and add a reference to that row in a column of table 1. If I’m working with only ONE reference: this works fine:
But the problem is that this completely overwrites the Associated Topics field even if there already exists a topic there. Since this is to be a many-to-many relationship, I’d prefer to append to the list rather than overwrite the field.
But in my testing, I’m not able to use the
AddRow() action from within either a
ListCombine(). If I try to, the action doesn’t launch and simply returns what I believe is a reference to some Action object (
Action ⚡). Wrapping the action in
RunActions() also doesn’t seem to help.
Does anyone have experience here? Thanks!
Hi @lamb and Welcome to the Community !
I’m fairly “aways from keyboard” but how about storing the reference to the brand new created row within a simple text field (like it can be done when setting up a simple
Add Row button and select the optional
Results column in the menu) and then use that field to add the row to the multi-select lookup field ?
This is what I did in the sample you’ll find below using this
Action formula :
So, the “1st” action modify the value in the text field
[Added rows] to add the reference to the brand new row the button creates (and is opened at the same time).
And the 2nd action modify the lookup field to add the reference of the brand new row to the list rows already selected .
[Added rows] can be hidden .
I hope this helps
You’re the best. (And thanks for the welcome!)
I was actually super close to having this solution but tried to do it in the form of a Text or Lookup control, both of which gave me the same problem where SetControlValue() caused the inner Action to be read as an object, rather than a function returning a reference.
One adjustment I made to your formula though is, rather than using an entire helper column, which is O(n) storage cost (one field per row), I created a helper “temp_var” table and set the values in there instead, which is O(1) storage cost (one field for ALL rows) and can be shared between tables who share this use case.
I can post the example when I’m home from work. I just use the current user as a key for the value to prevent situations where two people are trying to use buttons at the same time.
I wonder why the action executes in ModifyRows() but not SetControlValue().
Anyways, thanks again @Pch !
My pleasure @lamb !
I was just an idea !
And I’m very glad to know it helped you moving forward !
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.