How do I allow users to move to the next page in the journey / flow based on a user input match?

Hi, Here is what I’m trying to do. I want to create a filter in my current purchase journey where I’m using Wix Plans / Subscriptions. A user will be able to subscribe to a plan only if their email ID is present in a collection.

So, I need to set up a search based on the user input and then, if she is present, allow the user to move to the checkout page

Grateful if someone could please help

Ani

Hi,

From what I understand, you want to basically customize the flow for purchasing a pricing plan on your site. You can definitely do this with Corvid. I suggest taking a look at this tutorial here .
In this case, it sounds like you would need to query the collection that contains the email addresses that are permitted to purchase the pricing plan before they can purchase the plan. The tutorial provided should point you in the right direction on where to start.

Best regards,
Edward | Corvid Team

Thanks, Edward. Went through the tutorial. Need some clarity on point 2, where I check for the validity of an email id in a collection. How do I do this?

Hi,

If I understand the question correctly, if you are trying to search a data collection for a specific email address, I can suggest using the contains() function. Take a look at what it is and how to use it within this link here.

Best regards,
Edward | Corvid Team

Got it. Thanks. Here’s what I’m thinking of doing. I will first create a collection of the users who are allowed to purchase the plan. Then I will create an input box to prompt them to input their email ID which I will then match with the email ID in the collection using the contain() function and redirect users to the next step. Since I have zero coding experience and JS knowledge, it’s going to be a long night indeed!!

Perhaps even long week, who knows :grin:

This example here do not check any e-mail, but it also checks something…

https://russian-dima.wixsite.com/meinewebsite/id-check

This is the code for the example, perhaps you can use some parts of it :wink:

import wixData from 'wix-data';

$w.onReady(function () {   });

export function BTNcheck_click(event) {checkID()}

function checkID (parameter) {
    wixData.query("Check-ID")
    .eq("userId", $w('#TINPUT1').value)
    .find()
 
    .then( (results) => {
 if(results.items.length > 0) {
 let firstItem = results.items[0]; 
 let items = results.items
 //---------------------------------------
        console.log(items[0].userEmail)
        console.log(items[0].userName)
        console.log(items[0].userLastName)
        console.log(items[0].userId)
        console.log(items[0].aidState)
 //---------------------------------------
        $w('#BOXoutput').show()
        $w('#IMGyes').hide(), $w('#IMGno').hide()
 if(items[0].aidState===true) {$w('#TXToutput1').text = "No-Found-Data.", $w('#TXToutput2').text = "Yes, this person received aid from us.", $w('#IMGyes').show()}
 else {$w('#TXToutput1').text = "Found-Data.", $w('#TXToutput2').text = "No, this person did not receive aid from us.", $w('#IMGno').show()}


        } 
 else {console.log($w('#TINPUT1').value)
 if ($w('#TINPUT1').value==="") {$w('#BOXoutput').show(), $w('#TXToutput1').text = "", $w('#TXToutput2').text = "Please enter a ser-ID."}
 else {$w('#BOXoutput').show(), $w('#TXToutput1').text = "", $w('#TXToutput2').text = "Please enter a valid user-ID."}
 
        }
    setTimeout(()=>{$w('#BOXoutput').hide(), $w('#IMGyes').hide(), $w('#IMGno').hide()},2000)
    } )
    .catch( (err) => {
 let errorMsg = err;
    } );
    $w('#TXToutput2').html
}