How two-way sync work for same record types?

Hello Robert,

I’ve got a situation for two-way sync. We have a trigger for Donorperfect (add/update donor), when I create or update a donor I get a single response with all the details something like:

<root>
    <record>
        <field name="donor_id" id="donor_id" value="6045128"/>
	    <field name="first_name" id="first_name" value="Apiant1234"/>
	    <field name="last_name" id="last_name" value="Test3"/>
	    <field name="email" id="email" value="marici_test4@marici.io"/>
	    <field name="OPRGYR" id="OPRGYR" value=""/>
	    <field name="description" id="description" value=""/>
    </record>
</root>

If you see “OPRGYR” & “description” is empty for now and it’s a different table which is associated with the donor. If I do a single entry, it’s fine, something like:

<root>
    <record>
        <field name="donor_id" id="donor_id" value="6045128"/>
	    <field name="first_name" id="first_name" value="Apiant1234"/>
	    <field name="last_name" id="last_name" value="Test3"/>
	   <field name="email" id="email" value="marici_test4@marici.io"/>
	   <field name="OPRGYR" id="OPRGYR" value="1990"/>
	   <field name="description" id="description" value="Diversity on Board 2020"/>
    </record>
</root>

No issue until we add another entry for “OPRGYR” & “description”. If I add another entry for the same donor then the response would be like:

<root>
   <record>
        <field name="donor_id" id="donor_id" value="6045128"/>
	    <field name="first_name" id="first_name" value="Apiant1234"/>
	   <field name="last_name" id="last_name" value="Test3"/>
	   <field name="email" id="email" value="marici_test4@marici.io"/>
	   <field name="OPRGYR" id="OPRGYR" value="1990"/>
	   <field name="description" id="description" value="Diversity on Board 2020"/>
   </record>
    <record>
	    <field name="donor_id" id="donor_id" value="6045128"/>
	    <field name="first_name" id="first_name" value="Apiant1234"/>
	    <field name="last_name" id="last_name" value="Test3"/>
	    <field name="email" id="email" value="marici_test4@marici.io"/>
	    <field name="OPRGYR" id="OPRGYR" value="2001"/>
	    <field name="description" id="description" value="Leadership Akron Community Leadership Institute 9"/>
    </record>
</root>

Now my question is, would both data trigger in automation since it’s two-way sync or I should marge the response if multiple data added? something like:

<root>
	<record>
		<field name="donor_id" id="donor_id" value="6045128"/>
		<field name="first_name" id="first_name" value="Apiant1234"/>
		<field name="last_name" id="last_name" value="Test3"/>
		<field name="email" id="email" value="marici_test4@marici.io"/>
		<field name="OPRGYR" id="OPRGYR" value="1990"/>
		<field name="description" id="description" value="Diversity on Board 2020"/>
		<field name="OPRGYR" id="OPRGYR" value="2001"/>
		<field name="description" id="description" value="Leadership Akron Community Leadership Institute 9"/>
	</record>
</root>

Thanks
Vishwanath

Two-way sync is based on single data records that have a unique id and a last modified timestamp (or MD5 hash). So you need to merge fields into a single record.

1 Like