cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
rsparks
Level: Powered On

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
Level 10

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.

Highlighted
v-zhos-msft
Level 10

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.

8 REPLIES 8
Super User
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
Level: Powered On

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?

Super User
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
Level: Powered On

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

Super User
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
Level 10

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.

rsparks
Level: Powered On

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

Highlighted
v-zhos-msft
Level 10

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.

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow Community User Group Member Badge

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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 176 members 3,914 guests
Recent signins:
Please welcome our newest community members: