SOLVED

Last Value Column from Another Column in Same List

Copper Contributor

Hi

 

I have a Start Date and an End Date column in my SP calendar and was wondering how I can create two new hidden columns that populate with the Last Start Date and Last End Date of the original two columns?

 

Thanks

6 Replies
Might I ask the use of this two hidden columns? By the way: Have you tried to create calculated columns here?

@Juan Carlos González Martín 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

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.

 

 


@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

best response confirmed by Yepitsme (Copper Contributor)
Solution
Not 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?"

@Robin Nilsson Yeah, I just worked that out as I was creating the new column.  Thanks for your help, everything appears to be working so far

1 best response

Accepted Solutions
best response confirmed by Yepitsme (Copper Contributor)
Solution
Not 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?"

View solution in original post