cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper II
Helper II

Disable button if user enters data for a day

Hi Everyone,

 

I have a button which opens a newform to update date in a SharePoint list (Attendance). So once the user updates the Attendance list with the date in the column "Date" i want the button to be disabled for the day and be active for the user from the next day basically after 12 AM. How can we do that? Please help

2 REPLIES 2
Super User III
Super User III

You can follow these steps:

1. Create a variable OnStart of your App:

Set(varHideButton,true);

Set(varUser,User().Email);

Set(MyDate,LookUp(Sort(Datasource,DateColumn,Descending),EmailColumn=varUser,DateColumn))
 
You can change EmailColumn to FullName if you have fullName as your column
 
2.Then on the Visible of the Button:
If(MyDate=Today(),true,false)
 
3. In the OnSelect of the Button:
Set(varHideButton,false)
 
4. In the DisplayMode of the Button:
If(varHideButton,DisplayMode.Disabled,DisplayMode.Edit)
------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Hi @aswin12345 ,

 

Try this:

1. Create a variable OnStart of your App:

Set(varUser,User());

set this below formula on DisplayMode of the submit button:

If(IsBlank(LookUp(SampleList,IsToday('DateColumn') && 'Created By'.Email = varUser.mail,ID)),DisplayMode.Edit,DisplayMode.Disabled)

 
I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
Krishna
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Proud to be a Super User!

Regards,
KrishnaV
Business Applications MVP
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (38,408)