web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Flow to save document ...
Power Automate
Answered

Flow to save document in SharePoint and extract metadata from (PDF) filename

(0) ShareShare
ReportReport
Posted on by 28

Hello,

 

We would like to create the following flow:

 

- An email with PDF attachment will send to a functional O365 mailbox. The PDF filename has the following structure: 001_LocA_Letter.pdf -- : Nr_Location_DocType.pdf

- Flow to save PDF from e-mail message and store in library

- Flow to extract metadata properties Nr, Location and DocType from PDF filename and save this as metadata in a document library including the PDF file.

 

Anyone has a good example?

 

 

 

 

 

Categories:
I have the same question (0)
  • PieterVeenstra Profile Picture
    13 on at

    HI @Webmagic,

     

    You could use DocParser for this.

     

    I wrote a post a while back about getting data from Invoices in PDF format:

    https://veenstra.me.uk/2018/09/26/do-you-process-your-invoices-with-microsoft-flow-and-docparser/

  • Webmagic Profile Picture
    28 on at

    Hello Pieter,

     

    Thanks, but for our case I need an option to extract the fields based on the filename of the PDF:

    Field01_Field02_Field03.pdf --> store file and populate Field01, Field02,Field03 as metadata in the document library.

     

    Any ideas?

  • Webmagic Profile Picture
    28 on at
     

     

    I would like to get metadata out of the filename using a Flow. Example - "PDF_DATE_USER.pdf"

    Sharepoint columns: Filetype: PDF Date: DATE User: USER

  • PieterVeenstra Profile Picture
    13 on at

    Ok, that is even easier.

     

    Simply run a

    split(<filename>, '_')

     

    where the <filename> can come form your dynamic content.

     

    The above exprssion can be used in a compose action. 

     

    You will thne have an array. 

     

     

     

  • Webmagic Profile Picture
    28 on at
    Hello Pieter,

    Thanks for your input. Do you have screenshot/visual example to make it more clear for me? I new in using flow. Thanks
  • Verified answer
    PieterVeenstra Profile Picture
    on at

    Hi @Webmagic,

     

    Doesthis help:

     

     

     

    SplitSelect.PNG

    The COmposeactions has 

     

    split(triggerBody()?['{Name}'],'_')
     
    By going to the inputs field,clicking on the Expression tab and then typeing split() and then you can click on the Dynamic content tab and select Name
     
    In the select you can then take the output from the compose
     
    in the Select mappings I use 
    outputs('Compose_2')[0]
    to select the first part of the file name
    outputs('Compose_2')[1]
    for the second part
     
  • Webmagic Profile Picture
    28 on at
  • Webmagic Profile Picture
    28 on at
  • Webmagic Profile Picture
    28 on at
  • Webmagic Profile Picture
    28 on at

    Thanks @Pieter_Veenstra for your help flow is working now:

     

    Flow.jpg

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard