Skip to main content

Notifications

Community site session details

Community site session details

Session Id : gnlPbE9cGFtYpH3lsqgtjK
Power Automate - Power Automate Desktop
Unanswered

Save screenshots by folder - Power Automate Desktop

Like (0) ShareShare
ReportReport
Posted on 8 Nov 2021 10:48:41 by 340

Hi team, 

Need help! 

I'm able to save the screenshot by the name Ex - Amazon

Now, I would like to save those screenshots by folder 
Ex - Flow must create a folder for all the screenshots with Amazon & create another folder for all the screenshots with Walmart


Feel free to ask for more details, if my explanation isn't clear.

Thank you in advance.

  • mathiaskjeldsen Profile Picture
    222 on 12 Jul 2024 at 06:33:07
    Re: Save screenshots by folder - Power Automate Desktop

    Hi

     

    I have stumbled across a few of your screenshot issues by now. I hope you got it solved. For future reference and for others who might end up here, this demo might be of assistance:

     

    Take screenshots and store them in folders - Power Automate Desktop

     

    Best regards

    Mathias Kjeldsen

  • MichaelAnnis Profile Picture
    5,721 Super User 2025 Season 1 on 11 Nov 2021 at 11:25:36
    Re: Save screenshots by folder - Power Automate Desktop

    Copy all the text below and paste it into you subflow.  These are actual commands. You can change the variable names after you paste it. I am not at my computer to give you screenshots.  Good luck:


    SET DownloadFolder TO $'''Downloads'''

    Folder.GetFiles Folder: DownloadFolder FileFilter: $'''*''' IncludeSubfolders: False FailOnAccessDenied: True SortBy1: Folder.SortBy.NoSort SortDescending1: False SortBy2: Folder.SortBy.NoSort SortDescending2: False SortBy3: Folder.SortBy.NoSort SortDescending3: False Files=> Files
    LOOP FOREACH CurrentItem IN Files
    Text.GetSubtext Text: CurrentItem CharacterPosition: 0 NumberOfChars: 6 Subtext=> Subtext
    IF (Folder.DoesNotExist Path: $'''C:\\Screenshots\\%Subtext%''') THEN
    # If C:\Screenshots doesn't exist, create it and set the new folder to 'DestinationFolder'
    Folder.Create FolderPath: $'''C:\\Screenshots''' FolderName: Subtext Folder=> DestinationFolder
    END
    File.Move Files: CurrentItem Destination: DestinationFolder IfFileExists: File.IfExists.DoNothing MovedFiles=> MovedFiles
    END

  • mithushalk Profile Picture
    340 on 11 Nov 2021 at 08:24:19
    Re: Save screenshots by folder - Power Automate Desktop

    Thank you @MichaelAnnis 

    I will definitely put this In my flow & get back to you.
    Could you please screenshot the demo for the latest solution?

  • MichaelAnnis Profile Picture
    5,721 Super User 2025 Season 1 on 10 Nov 2021 at 17:12:55
    Re: Save screenshots by folder - Power Automate Desktop

    Right, so, however it is named (if you gave me an example of a few, that would help), but my flow below would still work, you just might need to mess with how a screenshot name identifies to which folder it goes.  If you have hundreds of websites, then I would skip the switch functionality and go straight to:

     

    Get Files %AllScreenshots%

    For each %CurrentItem% in %AllScreenshots%
    Parse/Split/GetSubtext on %CurrentItem% to %DestinationFolderName%

    If %DestinationPath%\%DestinationFolderName% doesn't exist

    • Create Folder

    EndIF

    Move %CurrentItem% to %DestinationPath%

    End (For Each)

  • mithushalk Profile Picture
    340 on 10 Nov 2021 at 16:03:36
    Re: Save screenshots by folder - Power Automate Desktop

    I don't name it manually but based on the website name the screenshot will be adapted. So, it's completely dynamic.

  • MichaelAnnis Profile Picture
    5,721 Super User 2025 Season 1 on 10 Nov 2021 at 15:54:15
    Re: Save screenshots by folder - Power Automate Desktop

    You name the screenshot when you take it, correct?

  • mithushalk Profile Picture
    340 on 10 Nov 2021 at 14:15:04
    Re: Save screenshots by folder - Power Automate Desktop

    @MichaelAnnis 

    My screenshot names are not static, they're dynamic.
    I take screenshots from hundreds of websites.

    I take a screenshot from the Amazon website then a folder Amazon has to be created & move all the Amazon named screenshots into the folder.
    Same applies for different screenshots & websites.

  • MichaelAnnis Profile Picture
    5,721 Super User 2025 Season 1 on 08 Nov 2021 at 15:35:28
    Re: Save screenshots by folder - Power Automate Desktop

    You can paste this into a subflow:
    # Assuming all the screenshots are labeled ex. Amazon0001, Amazon0002, Walmart0001, etc. and saved to a specific folder (DownloadFolder). For my example, I will use the left 6 of the filenmae to determine the folder.
    SET DownloadFolder TO $'''Downloads'''
    Folder.GetFiles Folder: DownloadFolder FileFilter: $'''*''' IncludeSubfolders: False FailOnAccessDenied: True SortBy1: Folder.SortBy.NoSort SortDescending1: False SortBy2: Folder.SortBy.NoSort SortDescending2: False SortBy3: Folder.SortBy.NoSort SortDescending3: False Files=> Files
    LOOP FOREACH CurrentItem IN Files
    Text.GetSubtext Text: CurrentItem CharacterPosition: 0 NumberOfChars: 6 Subtext=> Subtext
    # Here, if you can determine the Destination Folder from the subtext, then you can just go straight to Set Destination Folder as %DestinationPath%\%Subtext%. If not, then use the following Switch/Case scenario.
    SWITCH Subtext
    CASE = $'''Amazon'''
    SET DestinationFolder TO $'''C:\\Screenshots\\Amazon'''
    CASE = $'''Walmar'''
    # Notice the "Walmar"; the "Get subtext" earlier only grabbed the left 6 characters.
    SET DestinationFolder TO $'''C:\\Screenshots\\Walmart'''
    DEFAULT
    IF (Folder.DoesNotExist Path: $'''C:\\Screenshots\\%Subtext%''') THEN
    # If C:\Screenshots doesn't exist, create it and set the new folder to 'DestinationFolder'
    Folder.Create FolderPath: $'''C:\\Screenshots''' FolderName: Subtext Folder=> DestinationFolder
    END
    END
    File.Move Files: CurrentItem Destination: DestinationFolder IfFileExists: File.IfExists.DoNothing MovedFiles=> MovedFiles
    END

     

    MichaelAnnis_0-1636385672498.png

    MichaelAnnis_2-1636385717485.png

     

     

     

  • mithushalk Profile Picture
    340 on 08 Nov 2021 at 12:58:04
    Re: Save screenshots by folder - Power Automate Desktop

    Thank you @MichaelAnnis!

    For better understanding, can you post the images of the flow?

  • MichaelAnnis Profile Picture
    5,721 Super User 2025 Season 1 on 08 Nov 2021 at 12:34:34
    Re: Save screenshots by folder - Power Automate Desktop

    So, I am assuming the following:

    • you can take the screenshot you want
    • you have already identified if it’s Amazon, Walmart, etc. 
    • Amazon, Walmart, etc is contained in the name of the each screenshot
    • You have all the screenshots saved to a single specific folder (we will call it %downloadfolder%

    I would design a process to put it in the right folder based on the name it contains.  If you determined Amazon or Walmart earlier, you that logic and assign the %Store% variable to each picture. So it essentially looks like this:


    get files from download folder

    for each file

    set the Store variable

    Switch Store (you can skip the whole switch process if you can determine the folder name based off the store variable such as %DestinationPath%/%Store%, the you could just skip Switch/Case and go directly to move file)

    Case Amazon

    set destination folder to Amazon folder

    Case Walmart

    set destination folder for Walmart

    (keep adding cases for all your different stores)

    Case Else

    If folder doesn’t exist

    Create Folder 

    End If

    Set destination folder (based off store name)

    End switch

    move file from download folder to destination folder

    end loop

     

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,645 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,997 Most Valuable Professional

Leaderboard