Sync queue. How to change?

Hi

I have MySQL DB

Part of structure:

A_S_Pysarenko_0-1738871256103.png

When creating a Request directly from his form, I add both the new Partner and the Contact Person associated with him, then an error occurs when trying to synchronize.

Judging by the json update, AppSheet first tries to write the Contacts table, and only after that Partners, and of course it fails, because it does not find the necessary key (the partner has not yet been created, and we are trying to write his contact person)

Question - on what principle does AppSheet build the sync queue and is it possible to somehow configure this order to avoid such an error?

Solved Solved
1 5 134
1 ACCEPTED SOLUTION

Hi,

What if you change the flow?
Instead  of adding the Partner, add the Contact and under the partner_id field you can select an existing one or create a new one.
Check if you get the error by using the Contact_Form.

If you want to add a new partner with multiple contacts, you could have an action to create a new record (just [id]) and open that record in a detail view (skip the form view).
Have all columns that needs to to be filled as quick edit, and then another action to add contacts.

Not sure about the first option but last one would definitely solve the problem. 

View solution in original post

5 REPLIES 5


@A_S_Pysarenko wrote:

AppSheet first tries to write the Contacts table, and only after that Partners,


Based on your diagram, the Partner table is the parent table of the Contact table.  There is a way to set this up formally.  You would do so by tapping on the setting named "Is part of" in the [partner id] column in your Contact table.

This will do 2 extra things automatically:

1)  On the Partner Form View, adding the [Related Contacts] column will present as an Inline table into which you can add Contact rows.  When you add a Contact row by tapping omn the Add button under the Inline table, you will go to the Contact Form.  When done, tap Save and then repeat this process for any additional contacts.  Once done with all contacts, tap Save on the Partner Form.   The Partner row will be saved first and then all Contact rows will be save.  NOTE: This is likely a deviate from you had already setup for Contact entry so some adjustment will be needed.

2)  Should you delete a Partner row, using the default delete action, all rows inthe [Related Contacts] list will also be automatically deleted.

I hope this helps!

thanks, WillowMobileSys
I tried this way. With this approach, the situation changes a little: The Partner is saved and synced, but further syncing also fails, since the queue is built Request->Contact. Any ideas?
sync error.gif

Hi,

What if you change the flow?
Instead  of adding the Partner, add the Contact and under the partner_id field you can select an existing one or create a new one.
Check if you get the error by using the Contact_Form.

If you want to add a new partner with multiple contacts, you could have an action to create a new record (just [id]) and open that record in a detail view (skip the form view).
Have all columns that needs to to be filled as quick edit, and then another action to add contacts.

Not sure about the first option but last one would definitely solve the problem. 

super. The first option works. Of course, it is not very transparent for the user, but it solves the synchronization problem. Thanks

But ideally you would setup the second option too for Partner addition.

Top Labels in this Space