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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / File name extraction, ...
Power Automate
Answered

File name extraction, separate components into variable

(0) ShareShare
ReportReport
Posted on by 23

Hi, everyone! I am relatively new to PAD, but I have seen how it can help increase my efficiency at work. With that said, I think I need a breakdown/better examples for what I want to do, if it is at all possible.

 

I work at a medical office, and daily, I am gathering information for patients to clear them for upcoming procedures. It is quite tedious to download a file, then upload the file, and search for the next file. From what I've researched, however, it seems that the following SHOULD be possible.

 

1. I still have to manually download a file, but I can save the file in this format: patient mrn - document type - date.pdf (so, for example, "12345 - ekg - 092421.pdf". I would like, upon file creation, for PAD to extract the three pieces of information and put them into a variable.

 

2. Once the information has been extracted, I want it to go to our EMR, enter in the patient's MRN, go to New Documents, type in the document type, then enter in the date, then upload the correct file.

 

I hope this makes sense, and I hope it is possible, or at least close enough to possible. Any feedback would be greatly appreciated! I'm still trying to figure everything out. Thank you!

I have the same question (0)
  • UK_Mike Profile Picture
    on at

    This will get the file details...

     

     

    Screenshot 2022-02-17 151802.png

  • Verified answer
    MichaelAnnis Profile Picture
    5,727 Moderator on at

    1)  download the file to a separate folder that is apart from where you keep all the other files.  This folder will act as a "to be processed" folder, and we can have PAD move it to the standard folder once the process is complete.

     

    2)  Having the "to be processed" folder also allows you to run this whenever you want.  So, if there is 1 file or many in the "to be processed" it will process them all.  In Power Automate Desktop, without a paid license, you have to initiate the run manually.  So, you can do this as often as you want.

     

    The flow will look something like this:

    Get Files from 'C:\To be processed' to %Files% (a list variable of all filepath\filenames)

    For each %CurrentItem% in %Files%

        Split Text %CurrentItem.NameWithoutExtension% by custom delimiter " - " to %TextList%

            In this example, %TextList% should result in a List as follows:

                12345 (Index 0)

                ekg (Index 1)

                092421 (Index 2)

        'Here, inside the For Each Loop, you would put in your EMR processing actions.  You can reference an Index of the %TextList% as %TextList[Index#]; ex:

            %TextList[0]% is for the patient's MRN

            %TextList[1]% is for the procedure

            %TextList[2]% is for the date

        After all your EMR actions are complete:

        Move Files %CurrentItem% to C:\done (or whatever your proper folder is)

    End

     

    You could put the move files at the end and do them all at the same time; however, if this errors out in the middle, I don't think you want to risk duplicating the item in EMR.  So I would move each file as it finishes and if it does break, you know the ones in "to be processed" still need processed.

     

    best of luck!

  • arcylix Profile Picture
    23 on at

    Oh, this opens up so many other avenues for me, too! Once I verify it working, I'll accept this as solution. Thank you so much!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 605

#2
Valantis Profile Picture

Valantis 340

#3
11manish Profile Picture

11manish 284

Last 30 days Overall leaderboard