cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Update two fields in sharepoint list when a value changes in another field

Hi,

 

I am trying to build a flow that does the following:

 

In the field "Assigned to" (which is a person field), when I select someone and assign them a task, the flow then automatically updates the task status to Available, and also populates the field "Assigned to email", with the assigned persons email.

I have managed to get this to work, but the way I have done it means that everytime I update anything in the list, it triggers the flow....

flow new 1.pngflow new 2.pngflow new 3.png

So once someone has been assigned and the flow has updated the status and added the assigned to email, it will no longer trigger based on any other changes made to other fields in the list - only when the assigned to field is filled in or modified.

1 ACCEPTED SOLUTION

Accepted Solutions

Hi again!

Now let's discus a little bit about your goal:

"when I select someone and assign them a task, the flow then automatically updates the task status to Available"

 

IN my opinion, this means:

1.- If item is already created with an 'Assigned to', person, flow shall update tasks status to Available. FRom your current procedure experience, can this scenario happen?

2.- If item did not have 'Assigned to' person defined yet, and this value is added, this modification shall trigger your flow logic to update tasks status to Available. FRom your current procedure experience, can this scenario happen?

3.- If item already had 'Assigned to' person defined, and item is modified, this modification shall NOT trigger your flow logic to update tasks status to Available.

4.- If an itemalready had 'Assigned to' person defined, and current person is replaced by another, this modification shall? shall not? trigger your flow logic to update tasks status to Available. FRom your current procedure experience, can this scenario happen?

 

So depending on the answers, I would suggest to add a yes/no new column (let's called 'Available set') whose default value is No, and is updated to yes by your trigger + a conditional trigger, so whenever this column value is yes, flow logic is not executed, or... activate version history on your Sharepoint list and use 'HTTP request to Sharepoint' to get current item value and previous version also. First approach is much more simple, Second approach is more elegant but more complicated to implement

 

Hope this helps

Did I make your day? If so, mark my response as 'Solution' !!!

También escribo sobre Power Automate en este Blog y en Twitter

View solution in original post

11 REPLIES 11
efialttes
Community Champion
Community Champion

Hi!

From your description, it seems everytime flow evaluates the condition, the result is false, since... 'Update item' is on the false branch, right?

Cn you hover your mouse over the dynamic content output you assigned to the left term of your current condition, and share the screenshot so we can see its complete name? Seems you are comparing totally different structures (i.e. date vs email), and that's why condition is always false

Thanx!

 

 

Did I make your day? If so, mark my response as 'Solution' !!!

También escribo sobre Power Automate en este Blog y en Twitter

Hi again!

Now let's discus a little bit about your goal:

"when I select someone and assign them a task, the flow then automatically updates the task status to Available"

 

IN my opinion, this means:

1.- If item is already created with an 'Assigned to', person, flow shall update tasks status to Available. FRom your current procedure experience, can this scenario happen?

2.- If item did not have 'Assigned to' person defined yet, and this value is added, this modification shall trigger your flow logic to update tasks status to Available. FRom your current procedure experience, can this scenario happen?

3.- If item already had 'Assigned to' person defined, and item is modified, this modification shall NOT trigger your flow logic to update tasks status to Available.

4.- If an itemalready had 'Assigned to' person defined, and current person is replaced by another, this modification shall? shall not? trigger your flow logic to update tasks status to Available. FRom your current procedure experience, can this scenario happen?

 

So depending on the answers, I would suggest to add a yes/no new column (let's called 'Available set') whose default value is No, and is updated to yes by your trigger + a conditional trigger, so whenever this column value is yes, flow logic is not executed, or... activate version history on your Sharepoint list and use 'HTTP request to Sharepoint' to get current item value and previous version also. First approach is much more simple, Second approach is more elegant but more complicated to implement

 

Hope this helps

Did I make your day? If so, mark my response as 'Solution' !!!

También escribo sobre Power Automate en este Blog y en Twitter

Michael_Shen_JT
Community Support
Community Support

it looks like the condition is not set properly with your requirement.

You may also check the run  history to check the input value.

Hi @BrendanZ1 

 

In the condition, you should compare similar items. I guess it is just Modified in the right side which is a date time column. You can change to Assigned to Email in the left and Modified by Email in the right. 

 

Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

@efialttes thanks for taking the time to look through my issue in such detail. I have started a trial list rather than working on my actual list so I can see what is happening more accurately with the data as well. So in doing so, I have tried building the flow from scratch again and I have got to this point:

 

When and item is created or modified and AssignedTo is equal to null, then do nothing, else, update items (add assigned to email and change status to available).

 

This works perfectly, but if I modify any other fields (change status to active) in the list once someone is assigned to the task, it changes the status back to available. I realise this is because the flow is seeing that the assigned to is not null, and therefore completes the action.

 

As you mentioned, having a Yes/No validation should fix it, so I am just working out how this would be done. As far as the overall process goes hopefully this helps;

 

  1. Someone puts in a job request via a powerapp.
  2. The manager then reviews and approves jobs. At this point the AssignedTo is blank and job status is Schedule.
  3. Then as a group, the staff help determine who to allocate the jobs to which is done through a powerapp.
  4. When the job details are completed in the powerapp form and saved, this fills in the AssignedTo field.
  5. Now the Flow is triggered and will update the AssignedTo email field and change the job status to available. (I need the Assigned to email field so that when the user signs in to their powerapp, they only see tasks allocated to them)
  6. Once the Flow has updated these two fields, I need it to not trigger when other fields in these items are modified etc.

So as far as the scenarios you have listed below, I would love to achieve all of them, but happy to leave out the swapping of staff allocation for the moment if that is making it more complicated, as it is not something that should occur much if at all.

Hi!

Did you considered merging steps 4. and 5.?

It has pros and cons, obviously.

Merging means you do not need a 'flow triggered when item is updated' anymore, so current challenge wil be overcome. But, if from time to time you need a manual intervention on your SP list to assign tasks to teammates, you must remember to update Status column to 'available' also.

 

Hope this helps

Did I make your day? If so, mark my response as 'Solution' !!!

También escribo sobre Power Automate en este Blog y en Twitter

I have managed to get this working now by using a Yes/No column as @efialttes  suggested.

So while the solution has been gained, I do have one last question;

 

My flows are seeming to be constantly triggered, even when items have not been created or updated. So is there a way to tell the flow to stop once it has achieved its set purpose?

 

Thanks for all the advice and help!

Hi!

I guess you implemented the evaluation logic after the trigger by means of a Condition action block, right?

So if your logic shall be executed only when the new 'Yes/No' column is set to Yes, you can probably move the condition evaluation to the trigger itself. This feature is called "Trigger Conditions", meaning flow will only start execution if condition is met.

 

Please have a look to the following screenshot, the trigger is a different one, but the concept is the same

 

Blog_KeyHolder_8.png

Did I make your day? If so, mark my response as 'Solution' !!!

También escribo sobre Power Automate en este Blog y en Twitter

@efialttes Ok this sounds about right. I have my trigger as being when an item is created or modified, check if AssignedTo is null, if so, go to the next step, otherwise do nothing. The next step then checks if StatusChange is equal to true

 

So I would need to swap the order of these two conditions?

And then in the Trigger Condition, as per your example, would I write the following: @equals(triggerBody()?['StatusChange'],true)

 

I am still getting my head around the logic, but I don't think I have it quite right, because when I look at what I have, it should mean that anytime the StatusChange column is set to Yes/True, then it will fire the flow......so perhaps I do something similar to yours with a @endsWith ?

@efialttes With a bit of googling, I have managed to make this work. I now have one more flow to change and I have my system working well thanks to your help!.

 

I have adopted this method for the other two flows that are part of this chain of updating the jobstatus.

 

Thanks again!!

Glad to help!

And please please please remember my signature, love for the ewoks is in the Kudos!😉

 

 

Did I make your day? If so, mark my response as 'Solution' !!!

También escribo sobre Power Automate en este Blog y en Twitter

Helpful resources

Announcements

Community will be READ ONLY July 16th, 5p PDT -July 22nd

Dear Community Members,   We'd like to let you know of an upcoming change to the community platform: starting July 16th, the platform will transition to a READ ONLY mode until July 22nd.   During this period, members will not be able to Kudo, Comment, or Reply to any posts.   On July 22nd, please be on the lookout for a message sent to the email address registered on your community profile. This email is crucial as it will contain your unique code and link to register for the new platform encompassing all of the communities.   What to Expect in the New Community: A more unified experience where all products, including Power Apps, Power Automate, Copilot Studio, and Power Pages, will be accessible from one community.Community Blogs that you can syndicate and link to for automatic updates. We appreciate your understanding and cooperation during this transition. Stay tuned for the exciting new features and a seamless community experience ahead!

Summer of Solutions | Week 4 Results | Winners will be posted on July 24th

We are excited to announce the Summer of Solutions Challenge!    This challenge is kicking off on Monday, June 17th and will run for (4) weeks.  The challenge is open to all Power Platform (Power Apps, Power Automate, Copilot Studio & Power Pages) community members. We invite you to participate in a quest to provide solutions to as many questions as you can. Answers can be provided in all the communities.    Entry Period: This Challenge will consist of four weekly Entry Periods as follows (each an “Entry Period”)   - 12:00 a.m. PT on June 17, 2024 – 11:59 p.m. PT on June 23, 2024 - 12:00 a.m. PT on June 24, 2024 – 11:59 p.m. PT on June 30, 2024 - 12:00 a.m. PT on July 1, 2024 – 11:59 p.m. PT on July 7, 2024 - 12:00 a.m. PT on July 8, 2024 – 11:59 p.m. PT on July 14, 2024   Entries will be eligible for the Entry Period in which they are received and will not carryover to subsequent weekly entry periods.  You must enter into each weekly Entry Period separately.   How to Enter: We invite you to participate in a quest to provide "Accepted Solutions" to as many questions as you can. Answers can be provided in all the communities. Users must provide a solution which can be an “Accepted Solution” in the Forums in all of the communities and there are no limits to the number of “Accepted Solutions” that a member can provide for entries in this challenge, but each entry must be substantially unique and different.    Winner Selection and Prizes: At the end of each week, we will list the top ten (10) Community users which will consist of: 5 Community Members & 5 Super Users and they will advance to the final drawing. We will post each week in the News & Announcements the top 10 Solution providers.  At the end of the challenge, we will add all of the top 10 weekly names and enter them into a random drawing.  Then we will randomly select ten (10) winners (5 Community Members & 5 Super Users) from among all eligible entrants received across all weekly Entry Periods to receive the prize listed below. If a winner declines, we will draw again at random for the next winner.  A user will only be able to win once overall. If they are drawn multiple times, another user will be drawn at random.  Individuals will be contacted before the announcement with the opportunity to claim or deny the prize.  Once all of the winners have been notified, we will post in the News & Announcements of each community with the list of winners.   Each winner will receive one (1) Pass to the Power Platform Conference in Las Vegas, Sep. 18-20, 2024 ($1800 value). NOTE: Prize is for conference attendance only and any other costs such as airfare, lodging, transportation, and food are the sole responsibility of the winner. Tickets are not transferable to any other party or to next year’s event.   ** PLEASE SEE THE ATTACHED RULES for this CHALLENGE**   Week 1 Results: Congratulations to the Week 1 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Community MembersNumber SolutionsSuper UsersNumber Solutions Deenuji 9 @NathanAlvares24  17 @Anil_g  7 @ManishSolanki  13 @eetuRobo  5 @David_MA  10 @VishnuReddy1997  5 @SpongYe  9JhonatanOB19932 (tie) @Nived_Nambiar  8 @maltie  2 (tie)   @PA-Noob  2 (tie)   @LukeMcG  2 (tie)   @tgut03  2 (tie)       Week 2 Results: Congratulations to the Week 2 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 2: Community MembersSolutionsSuper UsersSolutionsPower Automate  @Deenuji  12@ManishSolanki 19 @Anil_g  10 @NathanAlvares24  17 @VishnuReddy1997  6 @Expiscornovus  10 @Tjan  5 @Nived_Nambiar  10 @eetuRobo  3 @SudeepGhatakNZ 8     Week 3 Results: Congratulations to the Week 3 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 3:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji32ManishSolanki55VishnuReddy199724NathanAlvares2444Anil_g22SudeepGhatakNZ40eetuRobo18Nived_Nambiar28Tjan8David_MA22   Week 4 Results: Congratulations to the Week 4 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 4:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji11FLMike31Sayan11ManishSolanki16VishnuReddy199710creativeopinion14Akshansh-Sharma3SudeepGhatakNZ7claudiovc2CFernandes5 misc2Nived_Nambiar5 Usernametwice232rzaneti5 eetuRobo2   Anil_g2   SharonS2  

Check Out | 2024 Release Wave 2 Plans for Microsoft Dynamics 365 and Microsoft Power Platform

On July 16, 2024, we published the 2024 release wave 2 plans for Microsoft Dynamics 365 and Microsoft Power Platform. These plans are a compilation of the new capabilities planned to be released between October 2024 to March 2025. This release introduces a wealth of new features designed to enhance customer understanding and improve overall user experience, showcasing our dedication to driving digital transformation for our customers and partners.    The upcoming wave is centered around utilizing advanced AI and Microsoft Copilot technologies to enhance user productivity and streamline operations across diverse business applications. These enhancements include intelligent automation, AI-powered insights, and immersive user experiences that are designed to break down barriers between data, insights, and individuals. Watch a summary of the release highlights.    Discover the latest features that empower organizations to operate more efficiently and adaptively. From AI-driven sales insights and customer service enhancements to predictive analytics in supply chain management and autonomous financial processes, the new capabilities enable businesses to proactively address challenges and capitalize on opportunities.    

Updates to Transitions in the Power Platform Communities

We're embarking on a journey to enhance your experience by transitioning to a new community platform. Our team has been diligently working to create a fresh community site, leveraging the very Dynamics 365 and Power Platform tools our community advocates for.  We started this journey with transitioning Copilot Studio forums and blogs in June. The move marks the beginning of a new chapter, and we're eager for you to be a part of it. The rest of the Power Platform product sites will be moving over this summer.   Stay tuned for more updates as we get closer to the launch. We can't wait to welcome you to our new community space, designed with you in mind. Let's connect, learn, and grow together.   Here's to new beginnings and endless possibilities!   If you have any questions, observations or concerns throughout this process please go to https://aka.ms/PPCommSupport.   To stay up to date on the latest details of this migration and other important Community updates subscribe to our News and Announcements forums: Copilot Studio, Power Apps, Power Automate, Power Pages

Users online (643)