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

Filename data to library column

Hello,

 

I would like to fill in column data from informations in the file name of documents.

 

We right now have a Flow that saves PDF attachements from mails into document librarys, the names of the files are for example:

 

filename: 93483_test_blabla_2736212.pdf

 

The library has the following columns:

 

Filename l Info 1 l Info 2 l Info 3

 

Now I want the flow to not simply save the file but also fill in the information from the filename for example:

 

Filename l Info 1 l Info 2 l Info 3

934483    l test    l blablal 2736212

 

Is there any way to do that with a flow?

 

Thanks in advance

Niklas Döring

5 REPLIES 5
Community Support Team
Community Support Team

Re: Filename data to library column

Hi @Landlinie,

 

I assume that all the coming emails have the same format of subject. If yes, then you could take the following codes for a reference.

 

The flow is triggered by When an email arrives.

 

Then using Compose actions to get value for each column.

 

Add Compose action, using the following code to have each character separated by a “_”

split(triggerBody()?['Subject'],'_')

 

Add Compose2, use the following code to return the filename:

take(outputs('Compose'),1)

 

Add Compose3, use the following code to return info1:

take(skip(outputs('Compose'),1),1)

 

Add Compose4, use the following code to return info2:

take(skip(outputs('Compose'),2),1)

 

Add Compose5, use the following code to return info3. Because the info3 in the example is of type array, while string is needed in the code, so I use function string to format it as a string.

substring(string(skip(outputs('Compose'),3)),2,7)

 

Please take the following screenshot for a reference.

1.PNG 

 

More details about WDL, please check it at here:

https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-referenceat...

 

 

Best regards,

Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Administrator
Administrator

Re: Filename data to library column

Hello, @Landlinie!

Thank you for posting on the Flow Community Forum! Have you had an opportunity to apply @v-yamao-msft‘s recommendation to adapt your Flow? If yes, and you find that solution to be satisfactory, please go ahead and click “Accept as Solution” so that this thread will be marked for other users to easily identify!


Thank you for being an active member of the Flow Community!

-Gabriel
Flow Community Manager

-Gabriel
Microsoft Flow Community Manager
Landlinie
Level: Powered On

Re: Filename data to library column

Hello,

 

first of all thanks for the fast and in detail answer!

 

I wasn't in the office for a couple of days so I just read it today.

 

I have to say im completely new to flow and never even heard of compose before the post so I might sound a bit stupid, please forgive me for that. The link is sadly not working anymore it seems: https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-referenceat...

 

Right now the subject is random, only the filename has the right variables, but I think I could change that, if its not possible to grab the information from the file name.

 

To give you a better view heres a Screenshot of the Flow right now:

 Flow.png

 

 

There are alot of Flows for different Documents, all have the same steps just different origin and destination.

 

A new mail gets send to the mail adress and either gets sorted through the subject or an mail alias to a Folder, each flow checks a different folder, grabs the attachment and drops it in a document library on Sharepoint (each folder has a different library).

 

Each folder then has different colums in the document library, for example customer Number and invoice number. Our scanner has the ability to scan for Barcodes or OCR so we get the Information into the file name. Right now these columns then get filled out manually which is alot of work, we want to fill them out automatically with flow.

 

It seems like the compose feature would be able to grab the data from the filename or subject, but I'm not quite sure how I get the data to the colums afterwards, could you help me with that?

 

Thanks in advance

Landlinie

Landlinie
Level: Powered On

Re: Filename data to library column

Anyone else got an idea? or is it not possible with flow?

Highlighted
Landlinie
Level: Powered On

Re: Filename data to library column

Still looking, someone got an Idea?

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: 189 members 4,661 guests
Please welcome our newest community members: