Dont let a form submit Based on 2 Values

HI,

I have been reading for hours and cant figure it out.
I have 10 Tables of questions being done as a form
on each there is a column for USEREMAIL and WEEK#
Week# is simlpy text Week 1, Week 2 ect

I need to make it so that a USEREMAIL can only submit the answers for each week once
So if the USEREMAIL and WEEK 1 are in the results table, in there proper columns, on the same row, 

i can give a message that they have already submitted this weeks answers and the form data is not added to the table.

I have been trying ifs and [_THISI] from various posts but am lost

HELP PLEASE

Solved Solved
0 10 132
1 ACCEPTED SOLUTION

Presume you have shared the image of pseudo data. if not please delete and always share pseudo data in community.

In the column where you wish to stop duplicate, you could use an expression something like below in the valid_if property of the column.

ISBLANK(
FILTER(
"Results",
AND([_THISROW].[WeekNumber] = [WeekNumber], [Useremail]=USEREMAIL())
)
- LIST([_THISROW])
)

Here Results is assumed to be name of the Results table.

You will find valid_if property of the column in column settings.

Suvrutt_Gurjar_0-1684383046013.png

 

View solution in original post

10 REPLIES 10

The community could help you more if you could add following details.

You mentioned about the [Week] field. Who updates it ( WEEK 1 , WEEK 2 and so on?) to indicate transition from WEEK 1 to WEEK 2 and so on.  

Could you share the relevant column structure of a table where you are trying to implement it? 

Is it [Email], [Week], [Q1], [A1], [Q2], [A2] .... and so on?

HI

Its a football pool
I have a table for each week of games with the teams

THe form from the schedule table submits
USEREMAIL()
TEAM NAME (chosen from list)
WEEK NUMBER

week number is just text put in for display purposes
So on the results table where lots of eople results go i need
One USEREMAIL() per WEEK1
One per week 2

So the same person can not submit a team for the same week more than once

 

The idea is that each player choose one game and team to win the game for each NFL week.  You can only choose one but i know people will forget they picked and submit twice

Sorry that you table structure is not yet clear.  You have mentioned a schedule table and a table for each week etc. But exact relationship between them is not clear to suggest something concrete,

Anyway, in general you could use expression in the valid_if property of a column to prevent duplicates as mentioned in the article below at the last section of the article.

List expressions - AppSheet Help

 

 

avoid this

Thats the results table and what i need to stop cause is same person and same week #

I thought the expression would go in the validate box for the form?

Presume you have shared the image of pseudo data. if not please delete and always share pseudo data in community.

In the column where you wish to stop duplicate, you could use an expression something like below in the valid_if property of the column.

ISBLANK(
FILTER(
"Results",
AND([_THISROW].[WeekNumber] = [WeekNumber], [Useremail]=USEREMAIL())
)
- LIST([_THISROW])
)

Here Results is assumed to be name of the Results table.

You will find valid_if property of the column in column settings.

Suvrutt_Gurjar_0-1684383046013.png

 

Thank you very much sir
That worked perfectly ( after i added a ] )
Exactly what needed.
You have a great night ๐Ÿ™‚

You are welcome. Oh yes, a missing ] was a typo. Thank you for mentioning it.  I have corrected it in the original post.

The form gets the List of teams (enum ) and games from another table,
And the results are put on this table.

Top Labels in this Space