cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sudosaurus
Post Prodigy
Post Prodigy

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
v-litu-msft
Community Support
Community Support

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.

v-litu-msft
Community Support
Community Support

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
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (5,362)