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

Attach PDF to flow from sharepoint list matching employee number

Hello,

 

I've been tasked with creating a flow that will send an email to all our staff with custom attachments.

 

A typical attachment would be in this format: "John.Smith-123456789.PDF" (FirstName.LastName-EmployeeNumber)

As we have approximately 1500 staff there are cases where we have duplicate names so simply cannot extract the name from the file and match it to a username.

 

I had a theory that if we have a list of All names, email addresses and employee numbers we could then match the employee number in the filename against the one in the list and send an email to the email address associated with the employee number attaching the PDF file.

 

What is the best way of doing this as I dont yet have the PDF files.

This is how my current flow looks.

 

email-flow.png

2 REPLIES 2
Community Support Team
Community Support Team

Re: Attach PDF to flow from sharepoint list matching employee number

Hi @sudosaurus,

 

You could refer to the following steps to create your Flow:

 

Step 1: Create the trigger When a file is created in the library.

Step 2: Process the file name without extension "John.Smith-123456789", to get the Employee Number "123456789" by using the expression - split(triggerBody()?['{Name}'],'-')[1]

Step 3: Use the Employee number to find the Employee item in the Employee list by using Get items with the Filter Query.

Annotation 2019-10-14 094417.png

Step 4: Get the file content from the trigger.

Step 5: Send email according to the Email address from Employee list.

Annotation 2019-10-14 094445.png

Please have a try, I hope it can help you.

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support Team
Community Support Team

Re: Attach PDF to flow from sharepoint list matching employee number

Hi @sudosaurus 

 

Has your problem been solved?
If your problem has been solved, You could go ahead and mark the post as solved by clicking “Accept as Solution” so that this thread will be marked for other users to easily identify!

Best Regards,
Community Support Team _ Lin Tu

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

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 Power Automate Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 134 members 5,309 guests
Please welcome our newest community members: