SOLVED

Last Value Column from Another Column in Same List

%3CLINGO-SUB%20id%3D%22lingo-sub-330261%22%20slang%3D%22en-US%22%3ELast%20Value%20Column%20from%20Another%20Column%20in%20Same%20List%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-330261%22%20slang%3D%22en-US%22%3E%3CP%3EHi%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20a%20Start%20Date%20and%20an%20End%20Date%20column%20in%20my%20SP%20calendar%20and%20was%20wondering%20how%20I%20can%20create%20two%20new%20hidden%20columns%20that%20populate%20with%20the%20Last%20Start%20Date%20and%20Last%20End%20Date%20of%20the%20original%20two%20columns%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-330261%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ECalculated%20Column%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EColumns%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-330452%22%20slang%3D%22en-US%22%3ERe%3A%20Last%20Value%20Column%20from%20Another%20Column%20in%20Same%20List%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-330452%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F189854%22%20target%3D%22_blank%22%3E%40Robin%20Nilsson%3C%2FA%3E%26nbsp%3BYeah%2C%20I%20just%20worked%20that%20out%20as%20I%20was%20creating%20the%20new%20column.%26nbsp%3B%20Thanks%20for%20your%20help%2C%20everything%20appears%20to%20be%20working%20so%20far%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-330449%22%20slang%3D%22en-US%22%3ERe%3A%20Last%20Value%20Column%20from%20Another%20Column%20in%20Same%20List%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-330449%22%20slang%3D%22en-US%22%3ENot%20quite.%20I%20was%20expecting%20you%20to%20have%20one%20flow%20that%20triggers%20on%20your%20item%20change.%20Within%20that%2C%20you%20test%20if%20the%202%20fields%20are%20the%20same.%20If%20they%20aren't%2C%20you%20do%20your%20logic%20that%20you%20need%20to%20do%20when%20the%20end%20date%20has%20changed.%20THEN%20you%20have%20to%20set%20the%20lastenddate%20to%20be%20the%20same%20value%2C%20so%20the%20next%20time%20the%20item%20changes%2C%20it%20won't%20run%20your%20logic%20again.%20The%20Flow%20will%20always%20run.%3CBR%20%2F%3E%3CBR%20%2F%3EBasically%2C%20that%20'Last'%20field%20HAS%20to%20end%20up%20being%20the%20same%20as%20the%20main%20EndDate%20field.%20But%20it%20only%20becomes%20the%20same%20AFTER%20you've%20done%20your%20logic.%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%22My%20question%20is%20how%20do%20I%20create%20the%20Last%20End%20Date%20field%20so%20it%20copies%20from%20the%20End%20Date%20field%20but%20does%20not%20autoupdate%20when%20the%20End%20Date%20field%20is%20modified%3F%22%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-330426%22%20slang%3D%22en-US%22%3ERe%3A%20Last%20Value%20Column%20from%20Another%20Column%20in%20Same%20List%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-330426%22%20slang%3D%22en-US%22%3E%3CBLOCKQUOTE%3E%3CHR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F189854%22%20target%3D%22_blank%22%3E%40Robin%20Nilsson%3C%2FA%3E%26nbsp%3Bwrote%3A%3CBR%20%2F%3E%3CP%3EYes%2C%20this%20is%20about%20the%20only%20way%20to%20detect%20a%20change%20in%20a%20specific%20field%2C%20since%20workflows%20like%20SP2013%20and%20Flow%20don't%20give%20us%20access%20to%20the%20'last'%20value%20of%20the%20field.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20need%20to%20create%202%20separate%20fields%20-%20both%20date%20fields.%20And%20you%20have%20to%20keep%20them%20up%20to%20date%20in%20your%20Flow%20with%20this%20kind%20of%20logic.%20Sorry%2C%20this%20is%20pseudo%20code%20-%20I%20don't%20have%20a%20flow%20example.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20EndDate%20is%20not%20equal%20to%20LastEndDate%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3Bdo%20your%20end%20date%20changed%20logic%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3Band%20update%20the%20last%20end%20date%20field%20with%20the%20current%20end%20date%20value%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EOnce%20your%20flow%20is%20done%2C%20both%20fields%20are%20the%20same.%20The%20next%20time%20the%20flow%20runs%2C%20if%20the%20enddate%20hasn't%20changed%2C%20you%20won't%20run%20the%20same%20logic%20again.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CHR%20%2F%3E%3C%2FBLOCKQUOTE%3E%3CP%3ERight%2C%20which%20is%20what%20I%20am%20trying%20to%20do%20with%20the%20Last%20End%20Date%20field%20as%20a%20hidden%20column%20in%20the%20SP%20list.%26nbsp%3B%20My%20question%20is%20how%20do%20I%20create%20the%20Last%20End%20Date%20field%20so%20it%20copies%20from%20the%20End%20Date%20field%20but%20does%20not%20autoupdate%20when%20the%20End%20Date%20field%20is%20modified%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EOh%2C%20you%20mean%20put%20a%20flow%20on%20the%20Last%20End%20Date%20as%20well.%20Okay%2C%20that%20makes%20sense.%26nbsp%3B%20Thanks%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-330417%22%20slang%3D%22en-US%22%3ERe%3A%20Last%20Value%20Column%20from%20Another%20Column%20in%20Same%20List%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-330417%22%20slang%3D%22en-US%22%3E%3CP%3EYes%2C%20this%20is%20about%20the%20only%20way%20to%20detect%20a%20change%20in%20a%20specific%20field%2C%20since%20workflows%20like%20SP2013%20and%20Flow%20don't%20give%20us%20access%20to%20the%20'last'%20value%20of%20the%20field.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20need%20to%20create%202%20separate%20fields%20-%20both%20date%20fields.%20And%20you%20have%20to%20keep%20them%20up%20to%20date%20in%20your%20Flow%20with%20this%20kind%20of%20logic.%20Sorry%2C%20this%20is%20pseudo%20code%20-%20I%20don't%20have%20a%20flow%20example.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20EndDate%20is%20not%20equal%20to%20LastEndDate%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3Bdo%20your%20end%20date%20changed%20logic%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3Band%20update%20the%20last%20end%20date%20field%20with%20the%20current%20end%20date%20value%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EOnce%20your%20flow%20is%20done%2C%20both%20fields%20are%20the%20same.%20The%20next%20time%20the%20flow%20runs%2C%20if%20the%20enddate%20hasn't%20changed%2C%20you%20won't%20run%20the%20same%20logic%20again.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-330400%22%20slang%3D%22en-US%22%3ERe%3A%20Last%20Value%20Column%20from%20Another%20Column%20in%20Same%20List%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-330400%22%20slang%3D%22en-US%22%3E%3CBLOCKQUOTE%3E%3CHR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F60%22%20target%3D%22_blank%22%3E%40Juan%20Carlos%20Gonz%C3%A1lez%20Mart%C3%ADn%3C%2FA%3E%26nbsp%3Bwrote%3A%3CBR%20%2F%3EMight%20I%20ask%20the%20use%20of%20this%20two%20hidden%20columns%3F%20By%20the%20way%3A%20Have%20you%20tried%20to%20create%20calculated%20columns%20here%3F%3CHR%20%2F%3E%3C%2FBLOCKQUOTE%3E%3CP%3EI%20am%20looking%20to%20create%20a%20Flow%20that%20is%20triggered%20by%20a%20difference%20in%20value%20between%20the%20End%20Date%20and%20the%20Last%20End%20Date%20column.%26nbsp%3B%20I%20did%20try%20a%20calculated%20column%20but%20every%20time%20End%20Date%20updated%20Last%20End%20Date%20updated%20so%20I%20think%20I%20am%20missing%20something%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-330396%22%20slang%3D%22en-US%22%3ERe%3A%20Last%20Value%20Column%20from%20Another%20Column%20in%20Same%20List%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-330396%22%20slang%3D%22en-US%22%3EMight%20I%20ask%20the%20use%20of%20this%20two%20hidden%20columns%3F%20By%20the%20way%3A%20Have%20you%20tried%20to%20create%20calculated%20columns%20here%3F%3C%2FLINGO-BODY%3E
Highlighted
New 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
Highlighted
Might I ask the use of this two hidden columns? By the way: Have you tried to create calculated columns here?
Highlighted

@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

Highlighted

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.

 

 

Highlighted

@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

Highlighted
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?"
Highlighted

@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