I'm using an "execute an action on a set of rows" action from my "mixtures" table to copy a list of items from a template table called "temp_ingredients" to the child table of mixtures called "mix_ingredients". The template table is just a list of items with no association with the other tables. "Mixtures" and "Mix Ingredients" have a parent/child relationship.
From the Mixtures form, I have a button to run the action below but I don't have a way to pass the mixture_id to the child table through the copy_ingredients_mixture action. I tried to use the INPUT() function but it only seems to work with SETVALUE actions.
I have a multi-user app. Is there another way to copy records from an unrelated table to a child table with the correct parent_id?
A million thanks!
This is the action it's running:
Wow! I hadn't noticed that yet. That explains a few things!
All the INPUT() function does, in this context, is provide a temporary location to store a value. So, a workaround is to create your own temporary storage location. I usually do this, when needed, with a small utility table. "Parameters", that might look like this:
ID | User | Name | Value |
wedwer | John | Description | Just some Text |
fhghng | John | Invoice ID | 5436728 |
adfdfg | John | Temperature | 98.6 |
I then convert my actions to Grouped Actions, if and where needed and add actions like this:
Grouped Action:
In the action that retrieves the parameter, I will have an expression similar to:
NUMBER(ANY(SELECT(Parameters[Value], AND([User] = ANY(CurrentUser[ID]), [Name] = "Invoice ID")))
Note the usage of the NUMBER() function to convert the parameter value into the desired column type. This is not always needed but will be necessary in certain circumstances.
I hope this helps!
User | Count |
---|---|
16 | |
12 | |
9 | |
4 | |
2 |