Workflow: Second Action not triggering (add new row to another table)

Hi there,

My workflow has 2 “Change Data” actions, one which changes a column value of the current row and the 2nd action which Creates a new row in a different table.

The first action is triggering however the 2nd action doesn’t seem to do anything.

I’ve tested to make sure the 2nd action works (which it does), any ideas?

Please check that your first action is working correctly. If there is anyreason that it’s cancelled, the 2nd action won’t be triggered.

Yes the first action is working and triggering.

Video showing process / steps: https://drive.google.com/open?id=1cwfCNEwGfINtb9DR81x4EXq6dtTUWAZ8

You might want to check the log file for any errors. You can access it from the Workflow description.

This is the error:

"Error: Perform DataAction 'Add to order' failed because Field 'ID' in table 'OrdersDetails' having key '' is required to have a value. Error: Perform DataAction 'Add to order' 'Add to order' failed with exception Collection was modified; enumeration operation may not execute. ."

I’m confused however because this column (ID) has an Initial Value to set as the key. The action it self works perfectly fine when not used in a workflow.

Are you using the UNIQUEID() function to generate the ID value in OrderDetails? And after this Workflow completes, have you looked at the row in the table to be sure it has the ID written?

1 Like

John is right.

The problem is that the “Id” column of the “OrderDetails” table has an Initial Value of “[_RowNumber]”.
Effectively, you are using the row number as the key. You really do not want to do that. As John suggested you might want to specify an InitialValue of “UNIQUEID()”

Table “DGC Inventory” has the same problem.

1 Like

Thank you dudes, didn’t think it would have had that big of a difference trying to use [_rowNumber] as opposed to uniqueid().

Quote:

If you do not specify a key, and AppSheet cannot automatically find a good key, AppSheet will default to using the worksheet row number as the key. The row number is not a good key. If entries are moved or deleted, or if users add or delete entries simultaneously, the row number for each row will change and there is no way for AppSheet to uniquely identify the row. The Editor will give a warning if row number is chosen as the key.

From: