Skip to main content
Community site session details

Community site session details

Session Id : XK/63nTumL8PDjfhVLrGZR
Power Automate - Using Flows
Unanswered

File extension not being saved from Outlook attachments

Like (0) ShareShare
ReportReport
Posted on 25 Jul 2019 14:11:26 by 19

Hi

I using the 'Save my email attachments to a SharePoint document library' flow.

However, I needed to add the date to the name of the attachment, so i created the attached flow. However, the file type of the attachment is not saving - and i seem to be getting a second file being saved without the file extension with the following at the end of the file name - ".application_octet-stream".

 

Can someone look at the attached flow and tell me what I'm doing wrong here? I'm thinking there must be something very simple that I'm missing here?

 

Regards

JohnMSFlow_filetypenotsaving.JPG

  • JohnM1 Profile Picture
    19 on 08 Aug 2019 at 09:15:53
    Re: File extension not being saved from Outlook attachments

    Hi Mabel

     

    There's a screenshot of the file in the body of the message as well as the .png attachment.

     

    I guess that's whats causing this - problem is I can't prevent the screenshot from being sent. Is there any way around this?

     

    John

  • v-yamao-msft Profile Picture
    on 08 Aug 2019 at 09:00:40
    Re: File extension not being saved from Outlook attachments

    Hi @John01 ,

     

    If the email comes with only one attachment, then the flow will only create one file in the library.

     

    Please check the amount of attachments and try again with it.

     

    Best regards,

    Mabel          

     

  • JohnM1 Profile Picture
    19 on 06 Aug 2019 at 16:01:56
    Re: File extension not being saved from Outlook attachments

    MSFlowFilesCreated.jpg

    For some reason my flow is creating 2 files as per above - I only need one of these (the second one, the png file). How do I stop the other file being generated?

  • v-yamao-msft Profile Picture
    on 05 Aug 2019 at 09:38:47
    Re: File extension not being saved from Outlook attachments

    Hi @John01 ,

     

    You have renamed the apply to each to Apply to each Attachment on the email, you need to modify the function using dynamic content from within your flow.

     

    Please try with the following code:

    concat('.',last(split(items('Apply_to_each_Attachment_on_the_email')?['Name'],'.')))

     

    Best regards,

    Mabel   

           

  • JohnM1 Profile Picture
    19 on 31 Jul 2019 at 10:13:40
    Re: File extension not being saved from Outlook attachments

    Hi Mabel - see below:

     

    MSFlow_error.JPG

  • v-yamao-msft Profile Picture
    on 31 Jul 2019 at 07:51:36
    Re: File extension not being saved from Outlook attachments

    Hi @John01 ,

     

    Could you share an image of your current flow?

     

    The second image is one succeeded run details.

     

    About the first image, the first Compose action is using the following function. Dynamic content Name comes from the trigger.

    concat('.',last(split(items('Apply_to_each')?['Name'],'.')))

     

    Please show me the function you are using in the Compose function.

     

    Best regards,

    Mabel   

           

     

  • JohnM1 Profile Picture
    19 on 29 Jul 2019 at 15:29:10
    Re: File extension not being saved from Outlook attachments

    Hi Mabel - just following up my last comment from last Friday - can you explain that part?

  • JohnM1 Profile Picture
    19 on 26 Jul 2019 at 09:04:25
    Re: File extension not being saved from Outlook attachments

    Hi Mabel

     

    When I add that code i get an error message saying:

     

    'The repetition action(s) 'Apply_to_each' referenced by 'inputs' in action 'Compose' are not defined in the template'

     

    I assume this is to do with the second image you added where you define the input & output - however, I dont see anything coming up that allows me to enter those input & outputs?

     

    Ta

    John

  • v-yamao-msft Profile Picture
    on 26 Jul 2019 at 03:23:30
    Re: File extension not being saved from Outlook attachments

    Hi @John01 ,

     

    If you want to rename the attachment, you may need to add the following steps to get the file extension first.

     

    Please check the following flow for a reference.

     

    After Get attachment, add Compose action with the following code:

    concat('.',last(split(items('Apply_to_each')?['Name'],'.')))

     

    In the action Create file, configure the File Name field likes below.

     

    Please select dynamic content Body from action Get attachment for the File content field.

    1.PNG

    2.PNG

     

    Best regards,

    Mabel      

        

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1

Featured topics

Restore a deleted flow