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

Disabling a button when current date doesn't match the given date

So i have a QR code that puts out a email and then a date, then the email is used to find more data on the user. this all works.
But the date is also given as more of a security reason, when it doesn't match the current date the user shouldn't be able to press the next button to continue the process. 

the data this variable puts out is 24-07-2020, i checked this by putting it in a text field and looking at the output. 

WesselO_0-1595602154466.png

 

"Datum: " & _gastdatum

 

 
i tried adding the code below to the displaymode tag of the button itself, 

If(IsToday(DateTimeValue(_gastdatum, "DD-MM-YYYY")),
    DisplayMode.Edit,
    Disabled
)

 

 

But unfortunately, the button stays the same even thought he dates are matching.
If u need any more info please let me know. 
Any insight or help would be appreciated, thank you so much. 


1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User III
Super User III

Re: Disabling a button when current date doesn't match the given date

Hi @WesselO ,

 

Try this for the final time on DisplayMode property:

If(Text(Today(),"dd-mm-yyyy") = Text(_gastdatum, "dd-mm-yyyy"),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
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.

View solution in original post

9 REPLIES 9
Highlighted
Super User III
Super User III

Re: Disabling a button when current date doesn't match the given date

Hi @WesselO ,

 

try this:

If(Text(Today(),DateTimeFormat.ShortDate) = Text(gastdatum,DateTimeFormat.ShortDate),
    DisplayMode.Edit,
    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
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.
Highlighted
Super User III
Super User III

Re: Disabling a button when current date doesn't match the given date

Try

If(IsToday(DateValue(_gastdatum, "DD-MM-YYYY")), DisplayMode.Edit, Disabled )

If(Text(Today'"DD-MM-YYYY")=Text(_gastdatum, "DD-MM-YYYY"), DisplayMode.Edit, Disabled )

 

If you have issues, explain how you got the variable _gastdatum further 

------------

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.

Highlighted
Helper II
Helper II

Re: Disabling a button when current date doesn't match the given date

Hey Krishna, 
i tried this and unfortunately it doesn't work for me. 
after scanning the qr code with a correct date the button is still greyed out for me,

a screenshot below.

 

IMG_20200724_165834

Highlighted
Super User III
Super User III

Re: Disabling a button when current date doesn't match the given date

Hi @WesselO ,

 

try this:

if(Text(Today(),"dd-mm-yyyy") = Text(columnName,"dd-mm-yyyy"),Edit,Disabled)

Note: "dd-mm-yyyy" is case sensitive 

 

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
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.
Highlighted
Helper II
Helper II

Re: Disabling a button when current date doesn't match the given date

Hey eka24,

 

i tried both your solutions and unfortunately it didnt work for me.

the way i get this variable is through scanning a qr code, which is this link
https://chart.googleapis.com/chart?cht=qr&chl=example@email.nl,24-07-2020&choe=UTF-8&chs=400x400

i then proceed to split the email and the date from eachother like so,

Set(_gastemail, First(Split(btn_scanner_qr.Value, ",")).Result),
Set(_gastdatum, Last(Split(btn_scanner_qr.Value, ",")).Result)

this gets done on qr scan, after which the data gets shown on screen and u get the option to continue, this is where the button part comes in and the button should be disabled when the date isn't correct.

Highlighted
Helper II
Helper II

Re: Disabling a button when current date doesn't match the given date

hey KrishnaV, thank you for the continueous help.

i get a error code here, not sure what it is. 

WesselO_0-1595603310143.png

 

Highlighted
Super User III
Super User III

Re: Disabling a button when current date doesn't match the given date

Hi @WesselO ,

 

Try this:
Set this to Display mode property:

if(Text(Today(),"dd-mm-yyyy") = Text(columnName,"dd-mm-yyyy"),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
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.
Highlighted
Helper II
Helper II

Re: Disabling a button when current date doesn't match the given date

Hey krishnaV,

unfortunately i get the same error.

Highlighted
Super User III
Super User III

Re: Disabling a button when current date doesn't match the given date

Hi @WesselO ,

 

Try this for the final time on DisplayMode property:

If(Text(Today(),"dd-mm-yyyy") = Text(_gastdatum, "dd-mm-yyyy"),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
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.

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Come join us today! Find your favorite faces from the community presenting at the Power Platform Community Conference!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (3,554)