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 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 (550)