Hi all,
I'm trying to set a last value of a date picker to another date picker when its value changes. For example
Whenever the value of A changes I update the last saved value to "Previous value of A" .
I know that i can easily do this using a variable but since there is already a value in "Previous value of A" field things become confusing to me. This seems so easy but my brain isn't working
Thanks for your help
Solved! Go to Solution.
Hello @v-bofeng-msft ,
Thank you for sharing such a great idea ! I wanted to point out that in your method it worked only after the 2nd change because the first time i change the value it saves the new value and not the old one. To fix this issue while doing a clear collect i saved the current value of A.
ClearCollect(
Selectlog,
{Value: Avalue}
);
In this way we were always comparing the right value.
Thanks ! a great learning point 🙂 have a nice day
Hi @Anonymous_Hippo :
Do you want to get something like this:
I've made a test for your reference——
I assume 'Previous value of A''s Default value is
Today()
'A'
OnChange
Set(
IfChange,
true
);
Reset('Previous value of A');
Collect(
Selectlog,
Self.SelectedDate
)
'Previous value of A'
DefaultDate
If(
IfChange,
First(
LastN(
Selectlog,
2
)
).Value,
Today()
)
Best Regards,
Bof
Hello @v-bofeng-msft ,
Thank you for sharing such a great idea ! I wanted to point out that in your method it worked only after the 2nd change because the first time i change the value it saves the new value and not the old one. To fix this issue while doing a clear collect i saved the current value of A.
ClearCollect(
Selectlog,
{Value: Avalue}
);
In this way we were always comparing the right value.
Thanks ! a great learning point 🙂 have a nice day
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 |
---|---|
203 | |
46 | |
45 | |
45 | |
39 |
User | Count |
---|---|
280 | |
81 | |
80 | |
80 | |
69 |