Forum Discussion
Last Value Column from Another Column in Same List
- Feb 04, 2019Not quite. I was expecting you to have one flow that triggers on your item change. Within that, you test if the 2 fields are the same. If they aren't, you do your logic that you need to do when the end date has changed. THEN you have to set the lastenddate to be the same value, so the next time the item changes, it won't run your logic again. The Flow will always run.
Basically, that 'Last' field HAS to end up being the same as the main EndDate field. But it only becomes the same AFTER you've done your logic.
"My question is how do I create the Last End Date field so it copies from the End Date field but does not autoupdate when the End Date field is modified?"
jcgonzalezmartin wrote:
Might I ask the use of this two hidden columns? By the way: Have you tried to create calculated columns here?
I am looking to create a Flow that is triggered by a difference in value between the End Date and the Last End Date column. I did try a calculated column but every time End Date updated Last End Date updated so I think I am missing something
- Robin NilssonFeb 04, 2019Bronze Contributor
Yes, this is about the only way to detect a change in a specific field, since workflows like SP2013 and Flow don't give us access to the 'last' value of the field.
You need to create 2 separate fields - both date fields. And you have to keep them up to date in your Flow with this kind of logic. Sorry, this is pseudo code - I don't have a flow example.
If EndDate is not equal to LastEndDate
do your end date changed logic
and update the last end date field with the current end date value
Once your flow is done, both fields are the same. The next time the flow runs, if the enddate hasn't changed, you won't run the same logic again.
- YepitsmeFeb 04, 2019Copper Contributor
Robin Nilsson wrote:Yes, this is about the only way to detect a change in a specific field, since workflows like SP2013 and Flow don't give us access to the 'last' value of the field.
You need to create 2 separate fields - both date fields. And you have to keep them up to date in your Flow with this kind of logic. Sorry, this is pseudo code - I don't have a flow example.
If EndDate is not equal to LastEndDate
do your end date changed logic
and update the last end date field with the current end date value
Once your flow is done, both fields are the same. The next time the flow runs, if the enddate hasn't changed, you won't run the same logic again.
Right, which is what I am trying to do with the Last End Date field as a hidden column in the SP list. My question is how do I create the Last End Date field so it copies from the End Date field but does not autoupdate when the End Date field is modified?
Oh, you mean put a flow on the Last End Date as well. Okay, that makes sense. Thanks
- Robin NilssonFeb 04, 2019Bronze ContributorNot quite. I was expecting you to have one flow that triggers on your item change. Within that, you test if the 2 fields are the same. If they aren't, you do your logic that you need to do when the end date has changed. THEN you have to set the lastenddate to be the same value, so the next time the item changes, it won't run your logic again. The Flow will always run.
Basically, that 'Last' field HAS to end up being the same as the main EndDate field. But it only becomes the same AFTER you've done your logic.
"My question is how do I create the Last End Date field so it copies from the End Date field but does not autoupdate when the End Date field is modified?"