Integrating a signup form via GraphQL API

I am integrating a web form on a React-based site via JavaScript - it’s a simple signup form that adds a new User (item) to a board (along with some other fields).

I can create new items on a board via the API, however, I want to check whether their email exists first before creating the item - otherwise it just creates a duplicate record of that User.

To do this I am using items_by_column_values.
However, this compares a string and it appears that the string for the “email” column only compares it to the “text” property, not the “email” property i.e. compares email to “John Smith”, instead of “”.

How then, using items_by_column_values can I compare it to the “email” property, in order to determine whether it exists?

I could make a query for all of the items, and then do my own comparison, but if there are many items, this could get costly in terms of performance.

Of course, if there is a better way to integrate a web form like this programmatically, I’d be interested.

…I also just realised via the docs you can’t directly update an existing item.

So if I can locate the item via email, would I then have to delete that Item and create a new Item on the board with the information from the web form?

Perhaps I should have just integrated directly into Mailchimp, but the client requires the Lead information in Monday and that data then passed through Monday to Mailchimp.

Much appreciated.

Hi @danwebb!

Apologies for the delay in response.

Ahh okay, I see your dilemma here. In this case, you can definitely implement your own comparison, though I do understand that it would be costly in terms of performance.

Alternatively, if you were to store the emails in a Text column instead of an Email column, you would then be able to retrieve the duplicate items using the items_by_column_values query.

You can change an item’s column values using the API though. So if you did find a duplicate, you can either change it’s column values, or delete it.

What do you think?