Automatically Save and Rename Email Attachments to SharePoint using Power Automate

Поділитися
Вставка
  • Опубліковано 14 жов 2024
  • Step by step instructions on how to rename Microsoft Excel email attachments that includes the date and time and save them to a specific folder in SharePoint using Power Automate.
    Things you'll need to follow along for this video:
    Microsoft Business 365 account Business Basic
    Visit the link below to see the instructions at my website:
    www.tw-waytek....
    Be sure to subscribe to get all the latest technology tips and to visit my website where you can find the documented version of my videos.
    --------------------------------------------------------
    CONNECT WITH ME:
    My Website: www.tw-waytek.com
    ___________________________________

КОМЕНТАРІ • 32

  • @outsidethewall
    @outsidethewall 20 днів тому

    Thanks for sharing this! I was pulling my hair out all day trying to make sense of what was going wrong with my previous flows, this worked perfectly on the first try!

    • @tw-waytek
      @tw-waytek  20 днів тому

      Thank @outsidethewall for your positive feedback and congrats on getting it your first try as sometimes Power Automate can be a bit tempermental.

  • @darrenchewitt
    @darrenchewitt 2 місяці тому

    Super helpful! Do you have instructions for re-naming the Excel file email attachment (that arrives daily with a variable name) so that it always gets saved with the exact same file name (no date stamp) and over-writes the previous day’s file?

    • @tw-waytek
      @tw-waytek  2 місяці тому

      Hello @darrenchewitt, great question, this is a very simple flow with only 3 actions. First is the trigger, When a new email arrives V3, next is For Each, and last is Create file. In the create file action under file name, give your file a name then a "." and then the extension type, if the file is always an excel file then the file name would be FileName.xlsx. Give this a try and let me know how you make out.

    • @darrenchewitt
      @darrenchewitt 2 місяці тому

      @@tw-waytek Thank you so much - I got it to work! I was initially using the method you suggested, and the automation would work perfectly, adding the Excel file to the destination folder, but when trying to open the file, Excel was giving an error indicating the file format or file extension was not valid, and to verify that the file extension matches the format of the file. I did some tinkering and somehow the issue was resolved (it may be that I removed some of the spaces I had in my file name, although I still have one space in my file name and it now works). By the way, wouldn't there also need to be a Get Attachment action (New Email Arrives > For Each-Get Attachment > Create File)? That's how I have the steps set up here.

    • @tw-waytek
      @tw-waytek  2 місяці тому +1

      Great news and great job @darrenchewitt!! So both flows will work, you can still get the Attachment details from the When A New Email Arrives action but at the end of the day if you are getting the result you need, that's what counts. Keep up the good work!!

    • @jashmyn
      @jashmyn 17 днів тому

      @@darrenchewitt what kind of tinkering did you do? I am getting the same error, as did most people in the comments

    • @tw-waytek
      @tw-waytek  9 днів тому

      Hello @jashmyn , are you still have issues, feel free to send me some screen shots of the issue you are having at my contact form below:
      www.tw-waytek.com/contact-me/

  • @matusjakubcin2765
    @matusjakubcin2765 Рік тому +1

    Hello. Thank you very much for video. I am trying to follow this steps , but in the end during SAVE i am facing this error :
    Correct to include a valid reference to 'Compose GetFileName' for the input parameter(s) of action 'Compose_ConcatfileName'.
    Correct to include a valid reference to 'Compose GetFileExtension' for the input parameter(s) of action 'Compose_ConcatfileName'.
    Could you please help where can be the problem ?
    thanks

    • @tw-waytek
      @tw-waytek  Рік тому

      Hello @matusjakubcin2765, great question and thanks for reaching out. It looks like there could a syntax issue with the variable expression for 'Compose GetFileExtension', this was my example: last(split(variables(‘AttachmentName’),’.’)), or it could be the syntax issue with the variable expression for 'Compose-ConcatFullFileName', this was my example: concat(outputs(‘Compose-GetFileName’),’-‘,variables(‘Timestamp’),’.’,outputs(‘Compose-GetFileExtension’)). Double check your spacing in and around the period, hyphen or quotation marks for both of these and make sure to use single quotation marks as I've had issues with all three before. Give that a try and let me know how it goes, I look forward to hearing from you.

    • @rainvillegonzales2203
      @rainvillegonzales2203 Місяць тому +1

      The variable inside outputs() does not recognize spaces. Replace space w/ underscore, ie. outputs('Compose_GetFileExtension')

  • @gustavoaguilara.9873
    @gustavoaguilara.9873 Рік тому +2

    I have tried everything for days!! But it still breaks my file when I try to use a name different to the "Attachment Name"...
    It downloads the file, and it seems to be a .xlsx just like the original file... but when I try to open it shows a error saying that file format or file extension is not valid... or the file has been corructed...
    Any idea why? 😔😔

    • @gustavoaguilara.9873
      @gustavoaguilara.9873 Рік тому

      Mandé todo a la mierda, y lo que hice fue crear un nuevo flujo.... cuando detecte un nuevo archivo en la carpeta, modifique el nombre del nuevo archivo como "Move or Rename".... y funciona ~ creo

    • @tw-waytek
      @tw-waytek  Рік тому

      Hello Gustavo, thanks for reaching out and happy troubleshoot your issue. I need to understand more about how you are setting up your flow. Can you send me a screen shot of your flow to tyler@wayteksolutions.com?

  • @CharlotteGodding
    @CharlotteGodding 4 місяці тому

    Hi there,
    Sorry, I have a slightly different request but cannot find a solution anywhere and hoping you can help me please. I have a flow that pulls the attachment from Outlook and creates the file in SharePoint - all works fine!
    However, the file I receive in Outlook has a date added to the end i.e. TestData May 30 2024 or TestData June 6 2024 etc. I'm looking to remove the date of the end and just end up with 'TestData' so I can overwrite the file that is currently there to be able to link to Power BI.
    Any help would be very much appreciated.
    Thanks in advance,
    Charlotte

    • @tw-waytek
      @tw-waytek  4 місяці тому

      Hello @CharlotteGodding, thanks for reaching out and great question, I'll review it, test it, and get an answer to you sometime this week.

    • @tw-waytek
      @tw-waytek  4 місяці тому

      Hello @CharlotteGodding, what I recommend assuming your flow is based on the one from this video is to remove all the Variable and Compose actions and under the Create File action change the File Name to: TestData.xlsx and leave all else as is.
      This change will keep the file name the same no matter what the name of the attachment is and will overwrite the existing file each time the attachment is saved.
      Give it a try and if you have any issue feel free to reach out to me here: www.tw-waytek.com/contact-me/

    • @CharlotteGodding
      @CharlotteGodding 3 місяці тому +1

      @@tw-waytek Thank you so much, I really appreciate your help. It looks like it is working (adding a new version of the file with the updated file name), but I am getting this error when trying to open the file once in SharePoint;
      "Excel cannot open the file '****' because of the file format or file extension is not valid. Verify that the file has not been corrupted and that the file extension matches the format of the file"
      I have checked and both the file being received into Outlook and the option in the Create File are xlsx
      Thanks

    • @tw-waytek
      @tw-waytek  3 місяці тому

      Hello @CharlotteGodding , no problem, I'm happy to help, can you send me a screen shot of each action, including the "For Each action" in your flow from the link below:
      www.tw-waytek.com/contact-me/

  • @oscarramirez5282
    @oscarramirez5282 Рік тому +1

    Can you do the same with PDF files?

    • @tw-waytek
      @tw-waytek  Рік тому

      Hello, yes, PDF's will work just fine.

  • @fradinalexandre8958
    @fradinalexandre8958 6 місяців тому +1

    Doesnt work either - the excel file is properly saved to the folder, but it is only 1ko. It doesnt grab the content of the excel file

    • @tw-waytek
      @tw-waytek  5 місяців тому

      Hello @fradinalexandre8958, thanks for reaching out, can you send me some screen shots of your flow so I can help troubleshoot the issue, you can reach out to me in any way you prefer by going to the About Me section of this channel.

    • @VamoussajuniorFofana
      @VamoussajuniorFofana 5 місяців тому

      @@tw-waytek I have the same issue. Is it possible to have a solution. I think the issue arrive with the storage on sharepoint folder but not one drive folder. I don't understand why

    • @tw-waytek
      @tw-waytek  5 місяців тому

      Hello@@VamoussajuniorFofana, thanks for your question, can you share a screen shot of your flow with me by going to this link: www.tw-waytek.com/contact-me/. It shouldn't matter whether you use SharePoint or OneDrive. I'm happy to try and help troubleshoot this for you.

    • @VamoussajuniorFofana
      @VamoussajuniorFofana 5 місяців тому +1

      @@tw-waytek Okay not problem

  • @evama383
    @evama383 10 місяців тому

    need to do "set variable" upfront. doing it inside the "for each" step is not allowed.

    • @tw-waytek
      @tw-waytek  9 місяців тому

      Hello @evama383, thanks for reaching out, the flow continues to work for me when putting the "set variable" inside of the "for each" step. Let me know if you have any more questions about the flow, you can email me directly by going to the About section.

  • @annamarievanwyk6411
    @annamarievanwyk6411 Рік тому

    I keep getting an error when trying to open the file. 'This workbook couldn't be opened because the file format may not be matching with the file extension'.

    • @tw-waytek
      @tw-waytek  Рік тому

      Hello annamarievanwyk6411 and thanks for your question, I came across this link while researching your issue, it gives several solutions but I'm guessing it is method 2, let me know how you make out with it:
      appuals.com/file-format-and-extension-dont-match/#:~:text=As%20it%20turns%20out%2C%20the%20%E2%80%98File,email%20attachments%20as%20a%20security%20option.&text=As%20it%20turns%20out%2C,as%20a%20security%20option.&text=turns%20out%2C%20the%20%E2%80%98File,email%20attachments%20as%20a

    • @bendreessen2809
      @bendreessen2809 7 місяців тому +1

      I followed each step in the video and each step in this article and nothing works! it breaks the workbook every time. I can manually drag the file over and it works but using a flow breaks it. even when just using the attachment name without any time stamp.

    • @tw-waytek
      @tw-waytek  7 місяців тому

      Hello @bendreessen2809,
      Sorry to hear that, feel free to send me an email of your flow, you can find my contact details in the About section.