cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

undefined

I need help from you if possible,
 
It consist for  every user to fill  their details within 3 weeks.And for that, the  form is connected to a SPList.
I want to restrict  a user when he has already entered his details such that after  filling  the form and submitting it to the SPList,it isn't possible for him within the 3 weeks to re-submit again the form,If he has to submit form for any reason,it should be for the next three weeks.
 I joined 3 forms  which are  the same because  I  have 3 weeks per user.
Thank in advance,
Capture800.PNGCapture801.PNGCapture802.PNG
 
 
 
1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Anonymous ,

Column name is Weeks.

DataCardValue38 is control name.

Try this formula:

Set(varUserEmail, User().Email);
If(!IsEmpty(LookUp(PReSales, 'Created By'.Email = varUserEmail && 
DateValue(Trim(Weeks)) = DateValue(Trim(DataCardValue38.Text)) )),
Notify("You have already submitted that week before"),
SubmitForm(YourForm)
)

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

10 REPLIES 10
Alex_10
Super User
Super User

What if you try if week saved as date:

Button.OnSelect =
Set(varUserEmail, User().Email);
If(!IsBlank(LookUp(SPlistName, 'Created By'.Email = varUserEmail && SPWeekColumn = DateValue(Trim(WeekTextInput.Text)) )),
Notify("You have already submitted that week before"),
SubmitForm(YourForm)
)

v-yutliu-msft
Community Support
Community Support

Hi @Anonymous ,

Could you tell me:

1)whether these three forms are submitted to the same list?

2)whether user submit these three forms in one time?

3)the differences between form1, form2 and form3?

If you only have one column for date(weeks), then you just need to justify whether date in weeks textinput has already existed in the data source.

Just like the formula that @Alex_10  provided:

Set(varUserEmail, User().Email);
If(!IsBlank(LookUp(SPlistName, 'Created By'.Email = varUserEmail && SPWeekColumn = DateValue(Trim(WeekTextInput.Text)) )),
Notify("You have already submitted that week before"),
SubmitForm(YourForm)
)

(SPWeekColumn = DateValue(Trim(WeekTextInput.Text)))

 

If you have three columns for weeks(week1,week2,week3 are stored in different columns), then you need to add some rules.

For example:

Set(varUserEmail, User().Email);
If(
   DateAdd(
           Last(
                Sort(
                    Filter(SPlistName, 'Created By'.Email = varUserEmail
                           ),SPWeekColumn
                     )
                ).SPWeekColumn,
             14,
             Days
            )=DateValue(Trim(WeekTextInput.Text)),
   SubmitForm(Form1),
   Notify("please submit this form per 3 weeks!"),
)

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi,

@v-yutliu-msft 

 

The three forms are submitted to the same list, user submit three forms in one time at the last form(It means that from the first form to the second user navigates,from the second to the third also,he submit only  just when he reach the last form.

 

Anonymous
Not applicable

Hi,

@Alex_10 

 

I got this error after entered the formula

IMG_20200823_114053.jpg

Anonymous
Not applicable

Hi @v-yutliu-msft ,

I have one column for Week in my SP list,so I can use the second formula you gave.

When I use the first formula I got this error:

 

IMG_20200823_114053.jpg

Hi @Anonymous ,

Could you tell me

1)the data type of PReSaleS field and whether it includes time?

2)the data's format in PReSaleS field? If you could list some examples, it will be better.

What's more, please use IsEmpty function instead of IsBlank function.

IsEmpty function is used to justify blank table.

IsBlank function is used to justify blank value.

Formula like this will return a table, not a value.

LookUp(SPlistName, 'Created By'.Email = varUserEmail && SPWeekColumn = DateValue(Trim(WeekTextInput.Text)) 

 

 

1)If PReSaleS field is text type and its data looks like: 8/3/20

Then please try this formula:

Set(varUserEmail, User().Email);
If(!IsEmpty(LookUp(SPlistName, 'Created By'.Email = varUserEmail && 
DateValue(Trim(SPWeekColumn)) = DateValue(Trim(WeekTextInput.Text)) )),
Notify("You have already submitted that week before"),
SubmitForm(YourForm)
)

2)If PReSaleS field is date type and it includes time, try this:

Set(varUserEmail, User().Email);
If(!IsEmpty(LookUp(SPlistName, 'Created By'.Email = varUserEmail && 
DateValue(Text(SPWeekColumn,DateTimeFormat.ShortDate))= DateValue(Trim(WeekTextInput.Text)) )),
Notify("You have already submitted that week before"),
SubmitForm(YourForm)
)

 3)If PReSaleS field is date type and it not includes time, try this:

Set(varUserEmail, User().Email);
If(!IsEmpty(LookUp(SPlistName, 'Created By'.Email = varUserEmail && SPWeekColumn = DateValue(Trim(WeekTextInput.Text)) )),
Notify("You have already submitted that week before"),
SubmitForm(YourForm)
)

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi @v-yutliu-msft ,

 

"PReSaleS" is the name of my SP list

Hi @Anonymous ,

Could you tell me the weeks field's name and field data type?

You need to compare a field with datevalue, not list.

The formula should be:

fielname= DateValue(Trim(WeekTextInput.Text))

 

 

Best regards, 

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi @v-yutliu-msft ,

the field name of Weeks is :"DataCardValue38" and the type is "single line of text"

 

fieldname.PNGfielddatatype.PNG

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (53,876)