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 / move email attachment ...
Power Automate
Unanswered

move email attachment to the right sharepoint folder

(0) ShareShare
ReportReport
Posted on by 13

Hello everyone. I'm really new to power automate and I want to realize a flow that works like this:

 

structogramm.png

 

So I've created this Nassi–Shneiderman diagram to show what I mean. I also started to create the flow in power automate but where I get stuck, is to get ONLY the year and ONLY the month as a number from the received email. I think I have to do something with the compose and variable steps but I really have no clue what I should enter there to achive this. I'm not new to coding and stuff but I'm a beginner and need a little bit help... 

 

Here is also my flow in power automate:

 

screen_1.png

screen_2.png

 

Many thanks to everyone 🙂

Categories:
I have the same question (0)
  • ScottShearer Profile Picture
    25,270 Most Valuable Professional on at

    @alexej1 

    When you say you want only the year and only the month as numbers from the email, what date are you looking at? 

    If you are looking at the received date, see my example below.  My expressions can be seen in the comments.

    image.png

  • alexej1 Profile Picture
    13 on at

    Hi Scott!

    First, I want to thank you for your response. It helped me a lot!

    But there are a couple of new problems I like to solve now. With your response I managed to create a folder with the name of the year. Also, I managed to rename the file the way I would like it, at least almost.

    Here are my "new" problems:

    1. The condition expression result always shots back with "false", even when the folder (e.g. 2021) exists

    screenshot_1.png

    I took a quick look in the outputs from the "List folder" step and as you can see the folder 2021 exists and is listed in the output:

     

    {
     "Id": "%252fFreigegebene%2bDokumente%252fASC%252fAdministratives%252fLohnabrechnungen%252f2021",
     "Name": "2021",
     "DisplayName": "2021",
     "Path": "/Freigegebene Dokumente/ASC/Administratives/Lohnabrechnungen/2021",
     "LastModified": "0001-01-01T00:00:00",
     "Size": 0,
     "IsFolder": true
     }
    ]

     

    Here is a screenshot from the configuration of the condition step. I tried it with the "Name" and "DisplayName" variable from the "List folder" step. The output variable is the year.

    condition_if_folder_exists.png

     

    2. The attachment file was named almost correctly

    screenshot_2.png

    It would be nice if the step could name the file like this:

    Example: 01_January_2021

    The reason for the "0" is that teams listing or sorts files like this:

    01, 02, 03 ...

    and when you name your files like: 1, 2, 3 ... and when you come to "10" and above it will not sorted correctly. Here is a screenshot from what I mean:

    screenshot_sorting.png

    Also I would like to add the month as text, shown in the example. Of course equal to the associated number of the month.

     

    Thank you so much!

    Greetings

  • alexej1 Profile Picture
    13 on at

    Hi Scott.

    Thank you very much for your helpful answer. However, there are still a few issues I would like to resolve.

    1. The condition expression result always shots back with "false" even when the folder (e.g. 2021) exists

    screenshot_1.png

    I looked at the outputs from the previous step and found the following:

    {
    "Id": "%252fFreigegebene%2bDokumente%252fASC%252fAdministratives%252fLohnabrechnungen%252f2021",
    "Name": "2021",
    "DisplayName": "2021",
    "Path": "/Freigegebene Dokumente/ASC/Administratives/Lohnabrechnungen/2021",
    "LastModified": "0001-01-01T00:00:00",
    "Size": 0,
    "IsFolder": true
    }
    ]

    as you can see the folder "2021" is listed and effectively exists in the directory.

    Here you can see the configuration of the condition step:

    condition_if_folder_exists.png

    I've tried it with the "Name" and "DisplayName" variable from the "List folder" step. The step still shots back with "false"...

     

    2. The file was named almost correctly

    screenshot_2.png

    I would like to have the file named like this:

    Example: 01_January_2021

    The reason for the "0" is that teams can't sort properly if you name your files like "1, 2, 3 ...". Here is a screenshot of what I mean. I have to name it like "01, 02, 03 ..." so that it will sort it correctly when I'm going to reach "10" and above.

    screenshot_sorting.png

    Also, it would be nice if the file contains the month as text, as shown in the example and of course equal to the associated number of the month.

     

    Thank you for your efforts to help me!

    Greetings.

  • alexej1 Profile Picture
    13 on at

    Hi Scott

    I figured out why the condition step always shot back with "false". It's because in the output from the "list folder" step you can see that there are " before and after the number.

     "Name": "2021",
     "DisplayName": "2021",

    The output from the compose step gives only the number (2021) without the ".

    So how can I fix this?

     

    Thanks for your help.

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 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard