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

Enable Save Button Icon on Datepicker date change

Hi ,
I have datepicker control in my gallery , if i change date then my save button icon should enable in edit mode.

i initially did set displaymode.view for save button icon then on datepicker on change if trying to change save button displany mode back to edit.  if(ThisItem.ID,DisplayMode.Edit,View) -- not changing save button display mode.

please advise.

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Hi @Anonymous 

 

You have the right approach. However, in your if statement you are just asking if ThisItem.ID is true or false. In other words, if ThisItem.ID isn't empty, it is true. And since ThisItem.ID is probably always true, it will just keep in the DisplayMode.Edit.

 

So, if you want to change the DisplayMode of your save icon based on your datepicker, you could do as follows:

  • On the OnChange property of your datepicker, set it to UpdateContext({lclDateChanged: true})
  • On the DisplayMode property of your Save Icon, change it to 

 

If(lclDateChanged,DisplayMode.Edit,DisplayMode.View)​

 

  • Once submitting the form, you should reset the lclDateChanged variable again. To do that, you could add the following line to the OnSelect property of your Save button

 

UpdateContext({lclDateChanged:false});​

 

I hope this helps.


Please click Accept as Solution if my post answered your question. Like my answer? Consider giving it a Thumbs Up. Others seeking the same answers will be happy you did.

Please click Accept as Solution if my post answered your question. Like my answer? Consider giving it a Thumbs Up. Others seeking the same answers will be happy you did.

View solution in original post

2 REPLIES 2
Super User
Super User

Hi @Anonymous 

 

You have the right approach. However, in your if statement you are just asking if ThisItem.ID is true or false. In other words, if ThisItem.ID isn't empty, it is true. And since ThisItem.ID is probably always true, it will just keep in the DisplayMode.Edit.

 

So, if you want to change the DisplayMode of your save icon based on your datepicker, you could do as follows:

  • On the OnChange property of your datepicker, set it to UpdateContext({lclDateChanged: true})
  • On the DisplayMode property of your Save Icon, change it to 

 

If(lclDateChanged,DisplayMode.Edit,DisplayMode.View)​

 

  • Once submitting the form, you should reset the lclDateChanged variable again. To do that, you could add the following line to the OnSelect property of your Save button

 

UpdateContext({lclDateChanged:false});​

 

I hope this helps.


Please click Accept as Solution if my post answered your question. Like my answer? Consider giving it a Thumbs Up. Others seeking the same answers will be happy you did.

Please click Accept as Solution if my post answered your question. Like my answer? Consider giving it a Thumbs Up. Others seeking the same answers will be happy you did.

View solution in original post

Anonymous
Not applicable

Thanks , Its perfectly working fine now 😊

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 (68,481)