cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ASLR
Helper I
Helper I

Approval for dynamic users

Hi Guys,

I’m a newbie to Microsoft Flow and been using it for a couple days so far and was wondering if there was any sort of documentation on the new actions such as Get Manager, Get Profile etc to fully understand it.

Also, I’m trying to create a functional workflow for a Leave Request App where there are two sets of Approvals. Manager and HR.

 

List Columns

Title: Single line of Text

Start Date: Date and Time

End Date: Date and Time

Comments: Single line of Text

Approved: Yes/No

Manager: Person or Group

Status: Single line of Text

 

During the request at this point in time, the requester has to type in the Manager’s Name in the Manager field therefore this field is dynamic as each user has a different manager. The AD isn’t set up to know who belongs to which department and the assigned manager therefore it will be selected by the user upon the request. Is there a way to send the request to the manager for approval only when the user types in the Manager’s name?

 

Another issue is the HR has a SharePoint Group where all emails/requests coming in has to go to selected users. How can I select a SharePoint Group to assign a task to?

 

Are we allowed to do calculations using these flows or should we still use SharePoint Designer to do so?

 

Thanks in advance,

Much appreciated.

ASLR

2 ACCEPTED SOLUTIONS

Accepted Solutions

Hi @ASLR,

 

A quick update on the PowerApps part. After doing some research, someone suggested a way to retrieve the current user's manager and automatically populate the corresponding manager field.

First, if you don't have a data connection to Office 365 Users, please set that up. Once you have this connection set up, these are the steps to follow:

  1. On the screen where your form is located, set the screen OnStart property to this:
    Collect(UserProfileCollection, Office365Users.MyProfile())
  2. On the same screen, set the OnVisible property to this:
    UpdateContext(
      {
        Manager: Office365Users.Manager(First(UserProfileCollection).Id)
      }
    )
  3. In the form, select the Person/Group DataCardValue and set its Default property to this:
    {
      '@odata.type':"Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
      Claims:Concatenate("i:0#.f|membership|",Manager.Mail),
      Department:Manager.Department,
      DisplayName:Manager.DisplayName,
      Email:Manager.Mail,
      JobTitle:Manager.JobTitle,Picture:""
    }

Here's the link to the post I used for reference since I asked the question in the forum 
The property expects Record values, but this rule produces incompatible Text values

 

I will continue working on the Flow as time permits and report back.

 

Fausto Capellan, Jr
Did I answer your question? Mark my post as a solution! Did my response help? Please give it a thumbs up!

View solution in original post

Glad you found that workaround. I tried it as well, but doing it directly in Azure AD using PowerShell seems to work better for syncing. Let me know if there's anything else I can assist with.

Fausto Capellan, Jr
Did I answer your question? Mark my post as a solution! Did my response help? Please give it a thumbs up!

View solution in original post

9 REPLIES 9
faustocapellanj
Memorable Member
Memorable Member

Hello @ASLR,

 

The comments below are opinions and suggestions for what you are trying to achieve. First, it seems like Flow documentation is lacking in many of the actions, but one thing I would do, for testing of course, I would create a workflow to be triggered manually and then call the specific action, which in my case, I called the Get My Profile action. This action just returned everything available on my profile such as User id, Display name, Email, Job title, Business phone, and many more. I would start there just to have an idea what I will get.

 

Second, for the Leave Request App, I think what you are trying to do is pretty straight forward. The only thing I think you need to determine is how to route the email/request to the selected HR SharePoint group. If there are several SharePoing groups for HR, you will have to set up conditions in order for the emails/requests to be routed to the pertaining HR group.

 

Question on the app: are you using a custom list form or PowerApps?

Fausto Capellan, Jr
Did I answer your question? Mark my post as a solution! Did my response help? Please give it a thumbs up!

Thank you, Faustocapellanj for your response.

 

The workflow is pretty simple and straightforward and the conditions used work perfectly. It’s already built in SharePoint Designer and works so the intention was to build this same workflow using Microsoft Flow because of the enhanced features like Mobile Approval via the Flow App and Approvals straight from an Email.

 

At this stage, a PowerApp is being used to submit the Leave Request or someone can submit a request from the custom list in SharePoint but I will like to make it simple too for the Approvers to approved stuff instead of going into the SharePoint List to approve it. I’ve been testing Flow for some days now and its super quick in sending out alerts and the interface looks very professional and well put together.

 

However, in building the Flow so far I’m facing the difficulty in pulling the Manager’s email when the requester enters the Manager’s email/Name in the Request Form itself and selecting the HR group from the SharePoint Groups so to assign the approval to the Manager and HR Group. Currently, I’m using a temporary email to ensure the flow is executing properly and it works for the first stage but when it reaches the HR for approval, the email comes in and the Flow Alert comes in but when I choose to approve it, I’m getting an error stating something went wrong and disappears from the Approval Feeds.

 

There is something I’m getting wrong when it comes to placing the correct Actions for getting profiles, manager profile etc.

  1. How can this work if those relationships are not defined clearly anywhere else in AD or Azure?
  2. Do I need to use ‘Get Manager’, ‘Get Profile’ actions etc before I use the Approval Action each time?

Hello @ASLR12,

 

Sorry for the late reply. Is there any chance you can post the SharePoint list structure, the PowerApps screen and the Flow steps so I can try to re-create it on my end and see if I can get it to work? Thanks

Fausto Capellan, Jr
Did I answer your question? Mark my post as a solution! Did my response help? Please give it a thumbs up!

The SharePoint List Structure:

Name of List: Vacation Test

 

Columns:

Title: Single line of Text

StartDate: Date and Time

EndDate: Date and Time

Comments: Single Line of Text

Manager: Person or Group

Status: Single line of Text

 

ManagerApproval: Choice (Yes/No)

HRApproval: Choice (Yes/No)

 

How can we customize the outcome fields as well to show up on the approval emails being sent to the emails and flow app?

 

Simple workflow process

 

Stage 1: Request for Vacation (Team Member)

Email goes to Manager

 

Stage 2: Manager Approval (Manager)

Approval Required

If yes go to Stage 3

If no go to end of workflow and email Team member

 

Stage3: HR Approval (HR Group)

Approval Required

If yes end workflow and email of approval goes to Team Member

 

When the Team Member submits a request to his manager, he should be able to select his manager on the Manager Field on the request form. (This is only temporary until we get to automatically populate the Manager of the Team Member from the Azure.) This is where I think I’m going wrong.

In Azure AD I selected a user profile of the manager and copied the Object ID to the Team Member profile as the Manager ID by a simple copy and paste. However, this isn’t creating the relationship because in Microsoft FLOW is stating

No manager found for the specified user. clientRequestId: c99a320e-e712-4ba2-8a62-a8311a1a53f8

 

Another issue is depending on the outcome of the conditions placed in the workflow how do I assigned the approvers for each stage If you cannot use the sharepoint groups. Also, In SharePoint Designer fields were created in individual content type with an outcome task but if we are using one list with the columns above how do we separate this in FLOW so that the requester would not see the ManagerApproval and HRApproval columns. Plus how would the approvers know which fields to look for when approving it since Flow only sends the emails with APPROVE AND REJECT AND THE FLOW APP to APPROVE OR REJECT.

 FLOW1.pngFLOW2.pngPOWERAPP1.JPG

 

Sorry about all the questions, just trying to understand how FLOW works better.

Thanks for all the help, really appreciate it.

Regards

Thanks for providing all that info @ASLR12. I'm also in the process of learning more about Flow and user cases like yours help more in the learning. I will post back if I have any other questions or if I get to figure out your scenario.

Fausto Capellan, Jr
Did I answer your question? Mark my post as a solution! Did my response help? Please give it a thumbs up!

No problem, thanks for your information. 

I am leaning towards an issue in the Azure AD relationship between the Manager and team member because when a static email is used in the Approval action in the Assigned To feild, it works fine but for some reason it is not pulling the Manager when it is left blank.The relationship between the Manager and Team Member was also relink in AD and it still did not work. 

 

There should be a way though in FLOW as an option to allow users to be selected dynamically by the requester like it did in SP Designer. Although,I appreciate Microsoft wants to make it easier when excuting this function it's always a good idea to have an option in case one doesn't work properly. 

 

Regards, 

ASLR12

 

 

 

 

Hi @ASLR,

 

A quick update on the PowerApps part. After doing some research, someone suggested a way to retrieve the current user's manager and automatically populate the corresponding manager field.

First, if you don't have a data connection to Office 365 Users, please set that up. Once you have this connection set up, these are the steps to follow:

  1. On the screen where your form is located, set the screen OnStart property to this:
    Collect(UserProfileCollection, Office365Users.MyProfile())
  2. On the same screen, set the OnVisible property to this:
    UpdateContext(
      {
        Manager: Office365Users.Manager(First(UserProfileCollection).Id)
      }
    )
  3. In the form, select the Person/Group DataCardValue and set its Default property to this:
    {
      '@odata.type':"Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
      Claims:Concatenate("i:0#.f|membership|",Manager.Mail),
      Department:Manager.Department,
      DisplayName:Manager.DisplayName,
      Email:Manager.Mail,
      JobTitle:Manager.JobTitle,Picture:""
    }

Here's the link to the post I used for reference since I asked the question in the forum 
The property expects Record values, but this rule produces incompatible Text values

 

I will continue working on the Flow as time permits and report back.

 

Fausto Capellan, Jr
Did I answer your question? Mark my post as a solution! Did my response help? Please give it a thumbs up!

Great post, much appreciated. 

 

I found a workaround as well

 

SharePoint Admin Center - Manage User Profile - Enter Usee's Name - Edit My Profile - Manager -enter manager's name and save. 

 

This will be sync to Azure and O365 Admin.

 

Thanks a million. 

 

Regards, 

ASLR12

 

 

 

Glad you found that workaround. I tried it as well, but doing it directly in Azure AD using PowerShell seems to work better for syncing. Let me know if there's anything else I can assist with.

Fausto Capellan, Jr
Did I answer your question? Mark my post as a solution! Did my response help? Please give it a thumbs up!

Helpful resources

Announcements

Community Roundup: A Look Back at Our Last 10 Tuesday Tips

As we continue to grow and learn together, it's important to reflect on the valuable insights we've shared. For today's #TuesdayTip, we're excited to take a moment to look back at the last 10 tips we've shared in case you missed any or want to revisit them. Thanks for your incredible support for this series--we're so glad it was able to help so many of you navigate your community experience!   Getting Started in the Community An overview of everything you need to know about navigating the community on one page!  Community Links: ○ Power Apps ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Community Ranks and YOU Have you ever wondered how your fellow community members ascend the ranks within our community? We explain everything about ranks and how to achieve points so you can climb up in the rankings! Community Links: ○ Power Apps ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Powering Up Your Community Profile Your Community User Profile is how the Community knows you--so it's essential that it works the way you need it to! From changing your username to updating contact information, this Knowledge Base Article is your best resource for powering up your profile. Community Links: ○ Power Apps ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Community Blogs--A Great Place to Start There's so much you'll discover in the Community Blogs, and we hope you'll check them out today!  Community Links: ○ Power Apps ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Unlocking Community Achievements and Earning Badges Across the Communities, you'll see badges on users profile that recognize and reward their engagement and contributions. Check out some details on Community badges--and find out more in the detailed link at the end of the article! Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Blogging in the Community Interested in blogging? Everything you need to know on writing blogs in our four communities! Get started blogging across the Power Platform communities today! Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Subscriptions & Notifications We don't want you to miss a thing in the community! Read all about how to subscribe to sections of our forums and how to setup your notifications! Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Getting Started with Private Messages & Macros Do you want to enhance your communication in the Community and streamline your interactions? One of the best ways to do this is to ensure you are using Private Messaging--and the ever-handy macros that are available to you as a Community member! Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Community User Groups Learn everything about being part of, starting, or leading a User Group in the Power Platform Community. Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Update Your Community Profile Today! Keep your community profile up to date which is essential for staying connected and engaged with the community. Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Thank you for being an integral part of our journey.   Here's to many more Tuesday Tips as we pave the way for a brighter, more connected future! As always, watch the News & Announcements for the next set of tips, coming soon!    

Calling all User Group Leaders and Super Users! Mark Your Calendars for the next Community Ambassador Call on May 9th!

This month's Community Ambassador call is on May 9th at 9a & 3p PDT. Please keep an eye out in your private messages and Teams channels for your invitation. There are lots of exciting updates coming to the Community, and we have some exclusive opportunities to share with you! As always, we'll also review regular updates for User Groups, Super Users, and share general information about what's going on in the Community.     Be sure to register & we hope to see all of you there!

April 2024 Community Newsletter

We're pleased to share the April Community Newsletter, where we highlight the latest news, product releases, upcoming events, and the amazing work of our outstanding Community members.   If you're new to the Community, please make sure to follow the latest News & Announcements and check out the Community on LinkedIn as well! It's the best way to stay up-to-date with all the news from across Microsoft Power Platform and beyond.    COMMUNITY HIGHLIGHTS   Check out the most active community members of the last month! These hardworking members are posting regularly, answering questions, kudos, and providing top solutions in their communities. We are so thankful for each of you--keep up the great work! If you hope to see your name here next month, follow these awesome community members to see what they do!   Power AppsPower AutomateCopilot StudioPower PagesWarrenBelzDeenujialexander2523ragavanrajanLaurensMManishSolankiMattJimisonLucas001AmikcapuanodanilostephenrobertOliverRodriguestimlAndrewJManikandanSFubarmmbr1606VishnuReddy1997theMacResolutionsVishalJhaveriVictorIvanidzejsrandhawahagrua33ikExpiscornovusFGuerrero1PowerAddictgulshankhuranaANBExpiscornovusprathyooSpongYeNived_Nambiardeeksha15795apangelesGochixgrantjenkinsvasu24Mfon   LATEST NEWS   Business Applications Launch Event - On Demand In case you missed the Business Applications Launch Event, you can now catch up on all the announcements and watch the entire event on-demand inside Charles Lamanna's latest cloud blog.   This is your one stop shop for all the latest Copilot features across Power Platform and #Dynamics365, including first-hand looks at how companies such as Lenovo, Sonepar, Ford Motor Company, Omnicom and more are using these new capabilities in transformative ways. Click the image below to watch today!   Power Platform Community Conference 2024 is here! It's time to look forward to the next installment of the Power Platform Community Conference, which takes place this year on 18-20th September 2024 at the MGM Grand in Las Vegas!   Come and be inspired by Microsoft senior thought leaders and the engineers behind the #PowerPlatform, with Charles Lamanna, Sangya Singh, Ryan Cunningham, Kim Manis, Nirav Shah, Omar Aftab and Leon Welicki already confirmed to speak. You'll also be able to learn from industry experts and Microsoft MVPs who are dedicated to bridging the gap between humanity and technology. These include the likes of Lisa Crosbie, Victor Dantas, Kristine Kolodziejski, David Yack, Daniel Christian, Miguel Félix, and Mats Necker, with many more to be announced over the coming weeks.   Click here to watch our brand-new sizzle reel for #PPCC24 or click the image below to find out more about registration. See you in Vegas!       Power Up Program Announces New Video-Based Learning Hear from Principal Program Manager, Dimpi Gandhi, to discover the latest enhancements to the Microsoft #PowerUpProgram. These include a new accelerated video-based curriculum crafted with the expertise of Microsoft MVPs, Rory Neary and Charlie Phipps-Bennett. If you’d like to hear what’s coming next, click the image below to find out more!   UPCOMING EVENTS Microsoft Build - Seattle and Online - 21-23rd May 2024 Taking place on 21-23rd May 2024 both online and in Seattle, this is the perfect event to learn more about low code development, creating copilots, cloud platforms, and so much more to help you unleash the power of AI.   There's a serious wealth of talent speaking across the three days, including the likes of Satya Nadella, Amanda K. Silver, Scott Guthrie, Sarah Bird, Charles Lamanna, Miti J., Kevin Scott, Asha Sharma, Rajesh Jha, Arun Ulag, Clay Wesener, and many more.   And don't worry if you can't make it to Seattle, the event will be online and totally free to join. Click the image below to register for #MSBuild today!   European Collab Summit - Germany - 14-16th May 2024 The clock is counting down to the amazing European Collaboration Summit, which takes place in Germany May 14-16, 2024. #CollabSummit2024 is designed to provide cutting-edge insights and best practices into Power Platform, Microsoft 365, Teams, Viva, and so much more. There's a whole host of experts speakers across the three-day event, including the likes of Vesa Juvonen, Laurie Pottmeyer, Dan Holme, Mark Kashman, Dona Sarkar, Gavin Barron, Emily Mancini, Martina Grom, Ahmad Najjar, Liz Sundet, Nikki Chapple, Sara Fennah, Seb Matthews, Tobias Martin, Zoe Wilson, Fabian Williams, and many more.   Click the image below to find out more about #ECS2024 and register today!     Microsoft 365 & Power Platform Conference - Seattle - 3-7th June If you're looking to turbo boost your Power Platform skills this year, why not take a look at everything TechCon365 has to offer at the Seattle Convention Center on June 3-7, 2024.   This amazing 3-day conference (with 2 optional days of workshops) offers over 130 sessions across multiple tracks, alongside 25 workshops presented by Power Platform, Microsoft 365, Microsoft Teams, Viva, Azure, Copilot and AI experts. There's a great array of speakers, including the likes of Nirav Shah, Naomi Moneypenny, Jason Himmelstein, Heather Cook, Karuana Gatimu, Mark Kashman, Michelle Gilbert, Taiki Y., Kristi K., Nate Chamberlain, Julie Koesmarno, Daniel Glenn, Sarah Haase, Marc Windle, Amit Vasu, Joanne C Klein, Agnes Molnar, and many more.   Click the image below for more #Techcon365 intel and register today!     For more events, click the image below to visit the Microsoft Community Days website.      

Tuesday Tip | Update Your Community Profile Today!

It's time for another TUESDAY TIPS, your weekly connection with the most insightful tips and tricks that empower both newcomers and veterans in the Power Platform Community! Every Tuesday, we bring you a curated selection of the finest advice, distilled from the resources and tools in the Community. Whether you’re a seasoned member or just getting started, Tuesday Tips are the perfect compass guiding you across the dynamic landscape of the Power Platform Community.   We're excited to announce that updating your community profile has never been easier! Keeping your profile up to date is essential for staying connected and engaged with the community.   Check out the following Support Articles with these topics: Accessing Your Community ProfileRetrieving Your Profile URLUpdating Your Community Profile Time ZoneChanging Your Community Profile Picture (Avatar)Setting Your Date Display Preferences Click on your community link for more information: Power Apps, Power Automate, Power Pages, Copilot Studio   Thank you for being an active part of our community. Your contributions make a difference! Best Regards, The Community Management Team

Hear what's next for the Power Up Program

Hear from Principal Program Manager, Dimpi Gandhi, to discover the latest enhancements to the Microsoft #PowerUpProgram, including a new accelerated video-based curriculum crafted with the expertise of Microsoft MVPs, Rory Neary and Charlie Phipps-Bennett. If you’d like to hear what’s coming next, click the link below to sign up today! https://aka.ms/PowerUp  

Super User of the Month | Ahmed Salih

We're thrilled to announce that Ahmed Salih is our Super User of the Month for April 2024. Ahmed has been one of our most active Super Users this year--in fact, he kicked off the year in our Community with this great video reminder of why being a Super User has been so important to him!   Ahmed is the Senior Power Platform Architect at Saint Jude's Children's Research Hospital in Memphis. He's been a Super User for two seasons and is also a Microsoft MVP! He's celebrating his 3rd year being active in the Community--and he's received more than 500 kudos while authoring nearly 300 solutions. Ahmed's contributions to the Super User in Training program has been invaluable, with his most recent session with SUIT highlighting an incredible amount of best practices and tips that have helped him achieve his success.   Ahmed's infectious enthusiasm and boundless energy are a key reason why so many Community members appreciate how he brings his personality--and expertise--to every interaction. With all the solutions he provides, his willingness to help the Community learn more about Power Platform, and his sheer joy in life, we are pleased to celebrate Ahmed and all his contributions! You can find him in the Community and on LinkedIn. Congratulations, Ahmed--thank you for being a SUPER user!

Users online (3,889)