You need to write the code for the page which is called by ajax to test if the user exists or not.
If you are not up with writing this kind of code, you can work around by using another small circle project that accesses the same database.
I will try to create you a better documented example next week, but here is the basic run down:
Create a plan file which has just one field in the recipient schema "email" and just one text ador object "email" that reads the schema value. There is no need for filters, queries etc.
Create a new circle project and link to the same uProduce server that you are using for the other project and upload the plan file.
If the first/main project is using a SQL table already, great, you will know where and what it is and can setup the new project datasource to be exactly the same database/table.
However, if you uploaded excel or csv, then you need to identify the right table and create a view from it... Login to SQL Mgt Studio. Go into the XMPDBHDS database and expand the tables list.
If the file you uploaded has a distinctive name, you should be able to find the SQL table pretty easy. If, like me, you have many "customer" files uploaded, you will first need to identify the schema ID that your campaign is using. If you need that, go into the XMPDB2 database, and open the TBL_CAMPAIGNS table. identify your campaign name, and get the campaign id. then in the TBL_DATA_SOURCE and get the scheme number from the datasourceConnection column of your campaignid row.
Now, back in the XMPDBHDS table create a new view which is basically a simple query: SELECT email FROM XMPieHDSSchema00000.tablename - obviously, you need to set your schema ID and tablename. Name the view something sensible like the tablename + "_view"
Back in circle, after uploading the plan file, go to the master list area of the library and setup the datasource pointing it to the SQL server and the XMPDBHDS database. When done, click the link to "add table" type in the name of the new view that you just created.
Now, go to the website tab and download the xmpcfg.js file.
OK. That's all you need to do in circle (no need to create touchpoints, or add a website.
Now to build your AJAX call, you simply call the XMPL REST api of the new project. The URL to call is determined by values in the xmplcfg.js that you just downloaded.
<url>/v1/projects/<accessToken>/adorvalues/context/?adors=email&rid=<emailToLookFor>
replace <url> with the url from the xmpcfg.js file
replace <accessToken> with the accessToken from the xmpcfg.js file
replace <emailToLookFor> with the email from the form page that you want to check before inserting...
The url will reply with either:
{"DisplayMessage":"Recipient ID is not valid","ExceptionMessage":"GetADORsValuesForRecipient failed. Exception details: The Port has returned an error message. Check uProduce Job Center, or Link to a different port. populationGUID=asdf recipientID=adsf","ErrorCode":5,"StatusCode":500,"RecipientID":"asdf","ServiceToken":"asdf","StackTrace":""}
or
So based on the reply from the API, you can either go ahead with the insert because the email does not already exist in the data, or display a nice message to the user about the duplicate.