cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
rsparks Helper IV
Helper IV

Determining a form submitter's manager by comparing form data to a sharepoint list

My organisation hasn't assigned managers to employees through Azure, so this is my workaround. When an employee submits a device request form, they also need to select their branch location from a dropdown.

 

I have created a list in sharepoint that is simply the branch location in column 1, and the branch manager's email in column 2. Once they've submitted the form the data is added into a sharepoint list. I want to get the branch location from this newly submitted list, then compare it to the "Branch Location - Branch Manager email" list to determine who the manager is for this employee. I then want it to take this branch manager email and add it as the recipient for the approval. 

 

Here is the flow currently (exluding the grabbing of the manager's email from the list):

1.PNG2.PNG3.PNG4.PNG

2 ACCEPTED SOLUTIONS

Accepted Solutions
v-zhos-msft Solution Sage
Solution Sage

Re: Determining a form submitter's manager by comparing form data to a sharepoint list

Hi @rsparks ,

It seems you want to get the corresponding manager's email depend on the loction value from the form.

I have made a flow for your scenario, please check it for a reference.

Capture1.PNGCapture2.PNG

Best Regards,

Community Support Team _ Zhongys

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

v-zhos-msft Solution Sage
Solution Sage

Re: Determining a form submitter's manager by comparing form data to a sharepoint list

Hi @rsparks ,

Please click the 'See more' button, then you can get the email option.

Capture3.PNG

Best Regards,

Community Support Team _ Zhongys

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

8 REPLIES 8
Dual Super User
Dual Super User

Re: Determining a form submitter's manager by comparing form data to a sharepoint list

Hi @rsparks , 

 

You can do this using the Get items action and Odata filtering. 

 

Under the When a New Item is Created Action, add an Action Get Items from Sharepoint. In that select the site and the Branch Location - Branch Manager Email list and under the filter option use this Branch Location eq '<select the location from the dynamic content of the crate a new item 2 action>'

 

This will return an array of exactly one item provided the ranch location is unique. Now in the approval Assigned to, select the Branch Manager Email from the Dynamic data content of the Get Items action. This will put the apporval action adn the follou up actions in an apply to each email (but if the location is unique it will only run one time as the Get items will return only one value)

 

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!

rsparks Helper IV
Helper IV

Re: Determining a form submitter's manager by comparing form data to a sharepoint list

I'm not seeing the option to assign it to the branch manager in the approval process. This is what comes up:

1.PNG

and this is the list column headings: 

2.PNG

Club / Service is the location (e.g. Manhattan). What am I missing?

Dual Super User
Dual Super User

Re: Determining a form submitter's manager by comparing form data to a sharepoint list

Hi @rsparks 

 

I am guessing your email field is a single line of text type. Please initialise a variable and add the email to that and use this variable for the approval. Please refer to the screenshot below. 

 

You might be wondering that the sharepoint item retrieved as email is also a string and the variable is also a string but approvals accept only email type and the variable tricks it into believing that. 

Picture1.png

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!

rsparks Helper IV
Helper IV

Re: Determining a form submitter's manager by comparing form data to a sharepoint list

As soon as I set up the "initialize variable" it nests it into an "apply to each", which sharepoint says it won't allow. Is there a way to prevent this?

 

1.PNG2.PNG

Dual Super User
Dual Super User

Re: Determining a form submitter's manager by comparing form data to a sharepoint list

Hi @rsparks 

 

Yep. Initialise the variable outside the apply to each loop. In the apply to each loop just use the action, set variable. 

 

I am assuming that there is just one email address per branch. If there are more than one, the approavh will differ and we will have to use the array type variables for that. 

 

Hope this helps. 

v-zhos-msft Solution Sage
Solution Sage

Re: Determining a form submitter's manager by comparing form data to a sharepoint list

Hi @rsparks ,

It seems you want to get the corresponding manager's email depend on the loction value from the form.

I have made a flow for your scenario, please check it for a reference.

Capture1.PNGCapture2.PNG

Best Regards,

Community Support Team _ Zhongys

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
rsparks Helper IV
Helper IV

Re: Determining a form submitter's manager by comparing form data to a sharepoint list

I think the main issue seems to lie with the way the email from the sharepoint list. Whenever i try to initialize the variable to set the emails as strings, it adds it into an apply to each loop. 

 

What should I set the column type in Sharepoint to, so that I can use it effectively? As you can see below I don't have the option. Though I can add the manager email into the details. Just not the recipient.

3.PNGHere is the full flow:

 

1.PNG2.PNG3.PNG

v-zhos-msft Solution Sage
Solution Sage

Re: Determining a form submitter's manager by comparing form data to a sharepoint list

Hi @rsparks ,

Please click the 'See more' button, then you can get the email option.

Capture3.PNG

Best Regards,

Community Support Team _ Zhongys

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Users online (6,543)