So I have a table, Productions, with 3 columns: datetime, ID, production. When this table has a new insert, it kicks off a workflow that kicks off an Action. I want the Action to gather the one new ID field that was part of the row that was inserted into the Productions table. Iโve attempted multiple variations of a SELECT function using MAX and MAXROW on the datetime column but no luck. Any suggestions? Iโm putting this expression in the โReferenced Rowsโ field of the Action. Thanks very much.
Solved! Go to Solution.
Not quite. The workflow gets the row automaticallyโthatโs just how workflow works. The workflow then invokes a configured action on that row, so the action gets the row specifically because the workflow gives the action the row. From there, other actions invoked by that initial action are only aware of the row theyโre invoked againstโand thatโs entirely up to you to determine.
What it appears youโre trying to do is to respond to a change in Productions table by updating some corresponding entry in the Inventory table. You noted:
Thatโs 100% correct.
Also 100% correct, assuming the value of the IT CLP column of the row from the Productions table is a Ref to a row in the Inventory table.
This is entirely where the breakdown is. Any given action is only aware of the row it was invoked for, but knows nothing about the row it was invoked from. The Update Drive Status action is invoked from a row in Productions for a row in Inventory (the row identified by [IT CLP]
), so Update Drive Status is only directly aware of the row in Inventory. You understood this, and were rightly trying to determine what row in Productions triggered the workflow. You simply chose a wrong approach in not understanding what Productions[Production]
meant.
This takes us back to thisโฆ
Unfortunately, youโre gong to have to do just thatโthereโs no other option. In my experience, you likely wonโt have to worry about a race condition. It seems that workflow is transactional, so nothing outside the workflow should be updating your data while the workflow is running.
If thatโs not good enough for you (and I can understand why it wouldnโt be), the alternative is to avoid workflow and attempt to perform all the actions from within the app itself with a Form Saved action, and/or by chaining the Inventory update actions to any existing actions that update Productions. The goal would be to organize the actions so they all run within the app directlyโwhere thereโs no contention with other users, and no chance for a race conditionโrather than in a workflow.
User | Count |
---|---|
31 | |
13 | |
3 | |
3 | |
2 |