I have a button that I want to disable once the info submitted and then enable the next day. I wrote this but it is not working
DisplayMode:
If(LookUp(
'Back to Work Eligibility',
Employee.Email = VarUserEmail,
'Next Check-In Date'
) < Now(),
DisplayMode.Edit,
DisplayMode.Disabled
)
Solved! Go to Solution.
Hi@lolla70,
I want to explain to you that the Lookup() function do return the first record of the SP list.
Do you mean that a user could have several records with different Check-in date in a same SP list?
If you want to lookup the latest record for the current user and compare with the Next Check-in date, I think you should try as below.
If(
First(
Sort(
Filter(
'Back to Work Eligibility',
Employee.Email = VarUserEmail
),
'Next Check-In Date',
Descending
)
).'Next Check-In Date' < Now(),
DisplayMode.Edit,
DisplayMode.Disabled
)
This is the the day when the current user could edit the button.
First(Sort(Filter('Back to Work Eligibility',Employee.Email=VarUserEmail),'Next Check-In Date',Descending)).'Next Check-In Date'
Hope it could help you.
Regards,
Qi
Assuming 'Next Check-In Date' is a date field, try:
If(LookUp('Back to Work Eligibility',Employee.Email = VarUserEmail).'Next Check-In Date' < Now(),
DisplayMode.Edit, DisplayMode.Disabled)
Hi@lolla70,
Based on the issue that you mentioned, do you want to disable the button based on the date?
Could you please share a bit more about the scenario, is this 'Next Check-In Date' a Date only type?
I have tested that if it is a Date only type, there will be something error when comparing it with the Now().
You should use the Today() to compare.
Please modify your formula as below:
If(LookUp('Back to Work Eligibility',Employee.Email=VarUserEmail,'Next Check-In Date')<Today(),DisplayMode.Edit,DisplayMode.Disabled)
Note that 'Next Check-In Date' in my SP list stores the created date so that it will always smaller than the Today() if you validate the button in next day.
Hope it could help.
Regards,
Qi
There is no error in the Formula but it didn't work.
Ok
I created a list in share point that it includes the Check-In Date and Next Check-In Date. On the App the process goes to click on a button answer some questions once they done, they click confirm and then go back to the main screen. I want the button to be disabled once they go back to the main screen and disable once the next day starts at 12:00AM. Also note that the employee may have a record everyday so the record is not updating. This is the way they want it in my company. Everything is working fine except this button. It work for couple of days with the coding I provide before but then it stopped working.
Hi@lolla70,
I want to explain to you that the Lookup() function do return the first record of the SP list.
Do you mean that a user could have several records with different Check-in date in a same SP list?
If you want to lookup the latest record for the current user and compare with the Next Check-in date, I think you should try as below.
If(
First(
Sort(
Filter(
'Back to Work Eligibility',
Employee.Email = VarUserEmail
),
'Next Check-In Date',
Descending
)
).'Next Check-In Date' < Now(),
DisplayMode.Edit,
DisplayMode.Disabled
)
This is the the day when the current user could edit the button.
First(Sort(Filter('Back to Work Eligibility',Employee.Email=VarUserEmail),'Next Check-In Date',Descending)).'Next Check-In Date'
Hope it could help you.
Regards,
Qi
Thank you so much. It worked.
Thank you all.
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
185 | |
55 | |
43 | |
35 | |
33 |
User | Count |
---|---|
263 | |
78 | |
75 | |
71 | |
67 |