Forum Discussion
One Date Picker Updates another Date Picker
- Oct 29, 2022
Matthew Carter Will the "Termination Date" field be changed by users from app OR it will be disabled for users and will be changed on when "Termination Date Modified" field is changed?
Try below solution for updating "Termination Date" field on change of "Termination Date Modified":
- Set OnChange & OnSelect property of TermDateModifiedDatePicker date control to:
Set(varPopulatedDate, Self.SelectedDate)
- Set the DefaultDate proeperty of the TerminationDateDataCardValue date control to varPopulatedDate
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.
ganeshsanap THANK YOU!
I set the termination date as you said with the variable for onselect and for onchange and I set the variable on the termination date and when I went to check, I set the date to x and then changed the modified date to y and x updated! THANK YOU!
I found that if I wanted to edit the item and update the date, it would set the "original" date to 2001 as it was "default" and it was set to that variable. Not knowing how to set the variable and knowing how to barely handle an IF statement, I went to the DefaultDate area and did an IF
I comment the original out as I am still learning. I set two variables one for the last working varPopulatedWorkDate and set it on DefaultDate
//Parent.Default
If(
IsBlank(varPopulatedWorkDate),
Parent.Default,
varPopulatedWorkDate
)
I did the same on
//Parent.Default
If(
IsBlank(varPopulatedDate),
Parent.Default,
varPopulatedDate
)