cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Thyagi
Helper III
Helper III

Update Manager for all Items in List

Dear All, Created a recurring flow to update manager details. Apparently flow is updating all entries with one manager details.

When my flow is executed, it updates all entries with manager email from the latest execution. As per below data, all list items is with updated with manager as 'Manager-1"

 

Appreciate if you could advise where the problem is. Whether in the iteration or passing the manager value

 

Sample Data:

Employee NameEmployee Manager
Person-1Manager-1
Person-2Manager-2
Person-3Manager-1

 

 

 

 

 

 

 

 

 

 

My Flow Snapshot :

MS Flow.JPG

1 ACCEPTED SOLUTION

Accepted Solutions

Hi!

AS I suggested before:

-Remove temporarily 'Filter array' output assigned to 'Apply to each' input, assign 'Get items' output instead

-Now, configure 'Get manager' inputs by selecting dynamic contents from the dynamic content menu. THis way you do not need to add expressions, Flow editor will do the magic

-Now, configure 'Update item' inputs by selecting dynamic contents from the dynamic content menu. THis way you do not need to add expressions, Flow editor will do the magic

-Once 'Get manager' and 'Update item' inputs are configured, remove 'Get items' output assigned to 'Apply to each' input, assign 'Filter array' instead

 

Please also note your Filter Array condition rule looks empty

Hope this makes sense



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



View solution in original post

13 REPLIES 13
efialttes
Super User III
Super User III

Hi!

 

Can you share details from your 'Filter Array'? I think the problem is, your Filter Array is providing all 'Get items' outputs, and since you placed 'Update item' inside the 'Apply to each 2' you are overriding all SP list entries.

 

So the key is, which entries do you need to update (not all, right?), how to define this requirement in your 'Filter Array' and how to get rid of  'Apply to each 2'... I believe you can remove it by doing the folowing:

-Delete 'Apply to each 2' and its content

-Remove temporarily 'Filter array' output assigned to 'Apply to each' input, assign 'Get items' output instead

-Now, add 'Update item', configure its inputs

-Once 'Update item' inputs are configured, remove 'Get items' output assigned to 'Apply to each' input, assign 'Filter array' instead

 

Hope this makes sense

 



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Yes. I intend to update all items. Reason being manager might change. Hence I wish to run MS Flow on daily basis to ensure desired field updated with latest manager email ID.

Filter Array details :

 

MS Flow_FilterArray.JPG

v-alzhan-msft
Community Support
Community Support

Hi @Thyagi ,

 

Please refer to screenshot below to create the flow:

1.png

 

The expression in the User field in the Get manager action as below:

items('Apply_to_each')?['EmployeeName']

The expression for the Id field in the Update item action as below:

items('Apply_to_each')?['ID']

The expression for the Title column in the Update item action as below:

items('Apply_to_each')?['Title']

 

Best regards,

Alice   

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Encountered Error  at 'Get Manager'

    "code""ResourceNotFound",
    "message""User not found"
 
Updated UPN expression to "items('Apply_to_each')?['EmployeeName']" and other expressions too highlighted by yourself 
 
 MS Flow_1.JPG

Hi!

AS I suggested before:

-Remove temporarily 'Filter array' output assigned to 'Apply to each' input, assign 'Get items' output instead

-Now, configure 'Get manager' inputs by selecting dynamic contents from the dynamic content menu. THis way you do not need to add expressions, Flow editor will do the magic

-Now, configure 'Update item' inputs by selecting dynamic contents from the dynamic content menu. THis way you do not need to add expressions, Flow editor will do the magic

-Once 'Get manager' and 'Update item' inputs are configured, remove 'Get items' output assigned to 'Apply to each' input, assign 'Filter array' instead

 

Please also note your Filter Array condition rule looks empty

Hope this makes sense



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



View solution in original post

No luck. Here is the modified flow :

MS Flow_2.JPG

Any suggestions please ?

Thyagi
Helper III
Helper III

@efialttes Unsure what type of magic is this as you mentioned. It worked like a charm. Thanks a lot

Hi!

I also struggled with such scenarios for a long time, unfortunatelly Flow editor and Filter array are not good friends.

THen one day I realized if you first define your 'Apply to each' assigning 'Filter array' input (in your case 'Get items' output) as 'Apply to each' input, and once everything is configured, you replace it and assign 'Filter array' output instead, then the magic is done.

Glad to help!



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



@efialttes When I apply flow against real time SharePoint List, it's updating manager details until 100th row. Is there any restriction as to only No. of row flow can update ? Please advise.

Hi!
'Get items' by default returns 100 items max.
You can increase the limits by adding a higher vaue in 'Top Count' or by activating pagination.
More info in this excellent article
https://alextofan.com/2019/08/22/how-to-get-more-than-5000-item-from-sharepoint-online-in-flow/
Hope this helps


Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



@efialttes  Enabled Pagination and set to 5000. Also tried updating Top count to 5000. Either ways it's going to default and settings are getting vanished

@efialttes  Thanks. It's Resolved. Not sure if my observation was right. One instance was 'In Progress' at the same time I made amendments. Possibly hence it had not taken effect. After all the execution was completed, amended settings again by changing Top Count it got applied successfully.

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (4,171)