Hi,
I am trying to save data from a form to multiple tables.
The form is for a transaction. For each transaction, data with the transaction details should get updated in Transactions table.
The Email and total should be updated/inserted in the Master table. In the Master table, Email id should be unique. So if the total is changed, the Master table should be updated.
I created both tables based on the form from Chronoforms.
I used the first DBSave to Insert the data into Transactions table.
Next I inserted a Custom Code to Unset the 'id' field.
Next I used a DB Read on the Master table to find a Matching field.
On Success, I update the Master table and On Fail, I Insert the data into the Master table.
The issue I am facing is, the data is updated/inserted into the Transactions table for both the Actions.
I tried changing the order of the DB actions and found that the table in the first DB Save action only was getting updated for both.
Can you help me resolve this issue?
I am trying to save data from a form to multiple tables.
The form is for a transaction. For each transaction, data with the transaction details should get updated in Transactions table.
The Email and total should be updated/inserted in the Master table. In the Master table, Email id should be unique. So if the total is changed, the Master table should be updated.
I created both tables based on the form from Chronoforms.
I used the first DBSave to Insert the data into Transactions table.
Next I inserted a Custom Code to Unset the 'id' field.
<?php
unset($form->data['id']);
?>
Next I used a DB Read on the Master table to find a Matching field.
On Success, I update the Master table and On Fail, I Insert the data into the Master table.
The issue I am facing is, the data is updated/inserted into the Transactions table for both the Actions.
I tried changing the order of the DB actions and found that the table in the first DB Save action only was getting updated for both.
Can you help me resolve this issue?