Limit who can submit a form

Hello,

I am looking to create a form that allows users to select a free gift. Only specific contacts are eligible to receive the free gift.

Is there a way (using Velo) to have a form only accept submissions from a list of pre-selected emails?

I would essentially need an IF/THEN clause that looks like, “if form submission contains an email on this list of contacts with the some label, accept submission”. Alternatively, “if email inputted is not on approved list”, throw an error message.

I don’t need the list of eligibility to live in contacts.

Any suggestions are appreciated.

Only specific contacts

This already means → that you have to get the OWNER/USER-ID first of the current logged-in user, right?

if(true) {...do something, because if-query successfuly passed...}
else {...do something else, because if-query not passed}

So this is a pseudo-skeletton-code, as example hot it maybe could look like…

$w.onReady(async()=>{
	let memberID = await getMemberID();
	if(true) {continue, because if-query successfuly passed}
	else {stop, because if-query not passed}
});

function getMemberID() {
	//write here the function to get the current logged-in MEMBER/USER-ID
	return memberID
}

So how to get the ID and DATA of the current-logged-in-MEMBER?

Try to use the VELO-SEARCH …
https://www.wix.com/velo/forum/search/logged-in-member-id