cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Teflonreis
Frequent Visitor

Flow for getting date of status change in a sharepoint list (with 7 statuses hence 7 nested conditions)

Hello everyone

 

I work with a sharepoint list, where I change the status of the projects. However, sharepoint does not store the date of status change.

I created 7 date columns for the 7 status choices a project can take.

Goal: If I change the status of a project to "delivered" on May 23rd, the list column date_delivered is filled with the date May 23rd.

 

For filling the date of status change in the list, I have a Flow full of conditions inside conditions...(nested 7 times): 

I would like to improve it using variables, apply to each or any other trick.

 

Condition 1: "Has column changed" is equal to "true"

If yes

1.png

Condition 1: "Has column changed" is equal to "true"

  If yes

     Condition 2: "Status Value" is equal to "Commisioning

        If yes Update Item "commisioning" column gets input utcNow()      

        If no

2.png

Condition 1: "Has column changed" is equal to "true"

  If yes

     Condition 2: "Status Value" is equal to "Commisioning

        If yes Update Item "commisioning" column gets input utcNow()      

        If no

            Condition 3: "Status value" is equal to "ready for shipment"

            If yes Update Item "ready for shiptment" column gets input utcNow()  

            If no

                  Condition 4:

                  .

                    .

                     .

until I covered all status columns/possibilities.

 

3.png4.png5.png

 

Any suggestions would be much appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
Pstork1
Dual Super User
Dual Super User

Swap out the nested IF statements after the first one for a switch based on the text of the status value. That will let you do it in 2 layers.

 

Condition 1: "Has column changed" is equal to "true"

 if yes

    Switch on lowercase(Status Value)

          Case: "commisioning"

                    Update Item "commisioning" column gets input utcNow()     

          Case: "ready for shipment"

                    Update Item "ready for shipment" column gets input utcNow()     

etc. until all cases are complete

 



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Join me at 365EduCon in Chicago on Sept. 26-30 where I'll be presenting on the Power Platform!

View solution in original post

2 REPLIES 2
Pstork1
Dual Super User
Dual Super User

Swap out the nested IF statements after the first one for a switch based on the text of the status value. That will let you do it in 2 layers.

 

Condition 1: "Has column changed" is equal to "true"

 if yes

    Switch on lowercase(Status Value)

          Case: "commisioning"

                    Update Item "commisioning" column gets input utcNow()     

          Case: "ready for shipment"

                    Update Item "ready for shipment" column gets input utcNow()     

etc. until all cases are complete

 



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Join me at 365EduCon in Chicago on Sept. 26-30 where I'll be presenting on the Power Platform!
Teflonreis
Frequent Visitor

Thank you very much. What a relief to know there is something called "Switch". Worked perfectly.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (4,413)