Skip to main content

Notifications

Power Automate - Building Flows
Answered

Get Department from specified Users

Posted on by 25
Hello, 
 
 
 
I am currently trying to build a flow which will receive all departments from specific users in my organization. 
 
 
 
I have a SP-List with ~600 users filled with UPN. 



In my PowerAutomate I load the UPN into an array and try to get the department back but I can not save my Flow with following expression:



Flow save failed with code 'InvalidTemplate' and message 'The template validation failed: 'The inputs of template action 'Get_user_profile_(V2)' at line '1 and column '2612' is invalid. Action 'For_each' must be a parent 'foreach' scope of action 'Get_user_profile_(V2)' to be referenced by 'repeatItems' or 'items' functions.'.'.

 
 
My Flow looks currently like this: (Picture: Flow.png)
 
 


My Users Array Input looks like:



[
 
  "John.Doe@company.com",
 
  "Mark.Smith@company.com",
 
  "barb.Wu@company.com"
 
]
 
 
 
GetUserProfile: (Picture: GetUser.png)

 
 
 
 
 
My target is to have a different SP-List with only the departments of the specified users.
 




if you need more information I am happy to share!
 
 
 
 
 
Thanks for the help in advance! 
 
 
 
Marco


EDIT
-------
Seems like the pictures are not showing up in my post. I attached them now
  • Verified answer
    Marco3353 Profile Picture
    Marco3353 25 on at
    Get Department from specified Users
    removing the "current item" from the Apply to each and change it to expression item() solved my problem!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,591

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 64,090

Leaderboard