# Sync check-out email with form input email?

**URL:** <https://forum.wixstudio.com/t/sync-check-out-email-with-form-input-email/30107>\
**Category:** Ask the community\
**Tags:** question, code\
**Created:** [January 8, 2020, 7:15pm UTC](https://forum.wixstudio.com/t/sync-check-out-email-with-form-input-email/30107 "2020-01-08T19:15:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bosslen](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/bosslen/32/16543_2.png) [@bosslen](https://forum.wixstudio.com/u/bosslen)\
**Post date:** [January 8, 2020, 7:15pm UTC](https://forum.wixstudio.com/t/sync-check-out-email-with-form-input-email/30107/1 "2020-01-08T19:15:37Z")

</div>

Hi all,

I am a pet portrait artist and I have a site where users can upload a photo of their pet, and then order a portrait. To make it as simple as possible, the upload form only requires them to submit their photo. Behind the scenes I have an email field which captures a temporary “placeholder” email which has contact syncing enabled.

I was hoping when the users entered their email at checkout that it would sync back and update the placeholder email with their actual email.

Instead, two separate contacts are being created, and no syncing is occurring. I asked WIX support about this but they were unable to help.

Any suggestions? Has anyone else had trouble syncing form submissions with checkout submissions?

Len

---

<div class="post-metadata">

**Author:** ![givemeawhisky](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/givemeawhisky/32/5383_2.png) [@givemeawhisky](https://forum.wixstudio.com/u/givemeawhisky)\
**Post date:** [January 9, 2020, 2:26am UTC](https://forum.wixstudio.com/t/sync-check-out-email-with-form-input-email/30107/2 "2020-01-09T02:26:58Z")

</div>

So when you talk about contact syncing, can we assume that you mean like this through the Wix Forms app?  
[https://support.wix.com/en/article/syncing-your-form-with-your-contact-list-fields](https://support.wix.com/en/article/syncing-your-form-with-your-contact-list-fields)

All user inputs from a Wix Form are saved in a submissions table and not a dataset.  
[https://support.wix.com/en/article/viewing-your-wix-forms-submissions-table](https://support.wix.com/en/article/viewing-your-wix-forms-submissions-table)

Note that Wix Forms is a Wix app and does not use code, whereas this Wix Corvid Forum is for all issues that are code related on your site.

If you are using the Wix Stores app for checkout, then you can add an additional field for the user to fill in already.  
[https://support.wix.com/en/article/adding-a-custom-field-to-the-checkout-in-wix-stores](https://support.wix.com/en/article/adding-a-custom-field-to-the-checkout-in-wix-stores)  
[https://support.wix.com/en/article/creating-and-viewing-buyer-notes-in-wix-stores](https://support.wix.com/en/article/creating-and-viewing-buyer-notes-in-wix-stores)

Finally, if your question does not involve the use of any code on your site, then you should be going through Wix Support for more info on Wix Forms app and Wix Stores app.

If you want to do something in Wix Corvid, then you are much better suited making up your own user input form through code and then using Wix Stores API to check email on checkout or get the email from billing info or buyers info from the Wix Stores Order collection.  
[https://support.wix.com/en/article/creating-a-form-with-user-input-elements](https://support.wix.com/en/article/creating-a-form-with-user-input-elements)  
[https://www.wix.com/corvid/reference/wix-stores-backend.Events.html#onCartCompleted](https://www.wix.com/corvid/reference/wix-stores-backend.Events.html#onCartCompleted)  
[https://www.wix.com/corvid/reference/wix-stores-backend.Events.html#CartCompletedEvent](https://www.wix.com/corvid/reference/wix-stores-backend.Events.html#CartCompletedEvent)  
[https://support.wix.com/en/article/corvid-wix-stores-orders-collection-fields](https://support.wix.com/en/article/corvid-wix-stores-orders-collection-fields)  
[https://support.wix.com/en/corvid-by-wix/wix-stores-with-corvid](https://support.wix.com/en/corvid-by-wix/wix-stores-with-corvid)

---

<div class="post-metadata">

**Author:** ![bosslen](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/bosslen/32/16543_2.png) [@bosslen](https://forum.wixstudio.com/u/bosslen)\
**Post date:** [January 9, 2020, 2:12pm UTC](https://forum.wixstudio.com/t/sync-check-out-email-with-form-input-email/30107/3 "2020-01-09T14:12:19Z")

</div>

GOS - thank you for the helpful information. I figured since the syncing wasn’t working as expected I would have to use code in some form but I wasn’t sure what the best way would be to do this. Your answer definitely pointed me in the right direction - I had one question: If I add a custom field in the store checkout, is there a way to:

1. Make the field hidden
2. Have the field auto populate with the wix user id?

I’m collecting the user id in the submission form so this would allow me to match those up with the checkout.

I’m new to corvid coding and the wix store checkout is difficult to incorporate code because you can’t see field ids, etc.

Thanks for your help.  
Len

---

<div class="post-metadata">

**Author:** ![givemeawhisky](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/givemeawhisky/32/5383_2.png) [@givemeawhisky](https://forum.wixstudio.com/u/givemeawhisky)\
**Post date:** [January 9, 2020, 3:20pm UTC](https://forum.wixstudio.com/t/sync-check-out-email-with-form-input-email/30107/4 "2020-01-09T15:20:02Z")

</div>

If you go through the Wix Stores Checkout with the custom fields, then you might find that you can’t make them hidden, it would either be have them for the user to fill in or don’t have them etc.

You can see if you can populate the custom text field with the user id.  
[https://www.wix.com/corvid/reference/wix-stores-backend.html#CustomTextField](https://www.wix.com/corvid/reference/wix-stores-backend.html#CustomTextField)

Surprisingly enough this was asked recently too, which you can see in this post here.  
[https://www.wix.com/corvid/forum/community-discussion/write-into-customtextfield-using-corvid-my-store-api](https://www.wix.com/corvid/forum/community-discussion/write-into-customtextfield-using-corvid-my-store-api)

Although, you can’t simply just use that one line, you would have to get the current users id and make the text value to be the users id.  
[https://www.wix.com/corvid/reference/wix-users.User.html#id](https://www.wix.com/corvid/reference/wix-users.User.html#id)

So it would be something like this which will fill the custom text field automatically when the page loads, just make sure that the element id matches the actual id name of the custom text field in the Wix Stores app checkout page.

```javascript
import wixUsers from 'wix-users';

$w.onReady(function () {
let user = wixUsers.currentUser.id;
$w('#customtextfield').value = user;
});

```

Finally, note that with Wix Users API it will only work properly when being tested on a live published website, it won’t work correctly when just used through the preview.

Note

- The APIs in wix-users are only partially functional when previewing your site. View a published version of your site to see their complete functionality.

- The APIs in wix-users can only be used once the page has loaded. Therefore, you must use them in code that is contained in or is called from the onReady() event handler or any element event handler.

---

<div class="post-metadata">

**Author:** ![bosslen](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/bosslen/32/16543_2.png) [@bosslen](https://forum.wixstudio.com/u/bosslen)\
**Post date:** [January 9, 2020, 3:41pm UTC](https://forum.wixstudio.com/t/sync-check-out-email-with-form-input-email/30107/5 "2020-01-09T15:41:33Z")

</div>

Thank you GOS, these links are very helpful. I will give it a shot!
