Dear Community Member,
I am creating an Inventory Management App. I have independent inventory holder entries on each row.
Now I want to create a form where we can migrate some units of inventory from one inventory holder to another.
In other words the Units column of type Number must decrease in lender row and increase in borrower row. The number of lended units should be dynamically specifyable as user input.
Forgive me if this is a silly or repeat question.
Regards,
Dhiraj
Solved! Go to Solution.
Got it! Somehow you need to specify the # of Units to transfer - unless you are always transferring ALL of the Units.
This is a way to do it IF you do not require keeping track of the history of the transfers. When you perform a second transfer, you would have to overwrite the first and then any knowledge of the first transfer would be gone (unless of course you are logging the activity after the fact).
You cannot do it in the SAME action. You will need to create two separate actions - one for RowA adjustment and a second for RowB adjustment. Then a third action would be a Grouped Action that lists both of them to execute together.
In your design, your RowB adjustment would still use the action type of: “data: add new row to another table using values from this row”. You would set the [Row Key Column] equal to:
[Row A].[TransferTo].[Row Key Column]
This will use the Key from RowB and since the row will already exist - perform an UPDATE instead of an add. Then in Set Columns, assign all the other columns, if still need to do to prevent overwriting as mentioned above, and you can use a similar expression for each one:
[Column Name] = [Row A].[TransferTo].[Column Name]
NOTE: You would NOT explicitly use the “=” when inserting the columns into the action. Instead, set the target column on the left-hand side to [Column Name]. Then apply the expression on the right-hand side.
For your Units adjustment, you would use the expression to modify the RowB Units. The below expression assumes a user specified amount. Otherwise, if ALL Units then use RowA’s Units column.
[Units] = [Row A].[TransferTo].[Units] + [_THISROW].[Transfer Units]
I hope its becoming more clear!?!?
User | Count |
---|---|
36 | |
8 | |
3 | |
2 | |
2 |