Forum Discussion

Yepitsme's avatar
Yepitsme
Copper Contributor
Feb 04, 2019
Solved

Last Value Column from Another Column in Same List

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

  • 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?"
  • Might I ask the use of this two hidden columns? By the way: Have you tried to create calculated columns here?
    • Yepitsme's avatar
      Yepitsme
      Copper Contributor

      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 Nilsson's avatar
        Robin Nilsson
        Bronze 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.

         

         

Resources