cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Invalid AttachmentName with trigger manual (mutiple file upload) and start approval

Hi,

I got several error on file name while attempting getting file from manual trigger (3 files upload enable). Photo is too large so i copy code 

Manual input

 

"file": {
                    "title""Quotation",
                    "type""object",
                    "x-ms-dynamically-added"true,
                    "description""Please select file or image",
                    "x-ms-content-hint""FILE",
                    "properties": {
                        "name": {
                            "type""string"
                        },
                        "contentBytes": {
                            "type""string",
                            "format""byte"
                        }
                    }
                },
                "file_1": {
                    "title""Reference ",
                    "type""object",
                    "x-ms-dynamically-added"true,
                    "description""Please select file or image",
                    "x-ms-content-hint""FILE",
                    "properties": {
                        "name": {
                            "type""string"
                        },
                        "contentBytes": {
                            "type""string",
                            "format""byte"
                        }
                    }
                },
                "text_3": {
                    "title""Job Number",
                    "type""string",
                    "x-ms-dynamically-added"true,
                    "description""Please enter your input",
                    "x-ms-content-hint""TEXT"
                },
                "file_2": {
                    "title""Price compare",
                    "type""object",
                    "x-ms-dynamically-added"true,
                    "description""Please select file or image",
                    "x-ms-content-hint""FILE",
                    "properties": {
                        "name": {
                            "type""string"
                        },
                        "contentBytes": {
                            "type""string",
                            "format""byte"

 

 

Action where error occurred

"attachments": [
                {
                    "name""@{triggerBody()?['file']?['name']}",
                    "content""@{triggerBody()?['file']?['contentBytes']}"
                },
                {
                    "name""@{triggerBody()?['file_1']?['name']}",
                    "content""@{triggerBody()?['file_1']?['contentBytes']}"
                },
                {
                    "name""@{triggerBody()?['file_2']?['name']}",
                    "content""@{triggerBody()?['file_2']?['contentBytes']}"
 
 I always got error message BadRequest. The request failed. Error code: 'InvalidAttachmentName'. Error Message: 'The attachment name '' is invalid.'.
 
I also tried with     ;  string(triggerBody()?['file']?['name']) but still error
 
What should I do?
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Invalid AttachmentName with trigger manual (mutiple file upload) and start approval

 

Hi @PamelaReeve27 ,

 

I could reproduce the same issue on my side.

Please ensure you have upload three files when you testing the flow.

This is  my test result:

8.PNG

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

8 REPLIES 8
Highlighted
Super User III
Super User III

Re: Invalid AttachmentName with trigger manual (mutiple file upload) and start approval

Hi @PamelaReeve27 

 

 

Add a compose and map the filename.

 

So for my example below

image.png

 

Above Compose action is mapped the below. You can find the value by clicking the three dots and see the peek code.
 
@triggerBody()['text']
 
Yes I agree it doesn't reflect the actual display name (filename) you using in the input field.
 


Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Highlighted
Dual Super User III
Dual Super User III

Re: Invalid AttachmentName with trigger manual (mutiple file upload) and start approval

Hi!

Are you uploading the three files? I mean, are all of them mandatory in your manual trigger input?

THanx!



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Highlighted
Frequent Visitor

Re: Invalid AttachmentName with trigger manual (mutiple file upload) and start approval

Not all mandatory, only 1 file ; 'Quotation'

Highlighted
Super User III
Super User III

Re: Invalid AttachmentName with trigger manual (mutiple file upload) and start approval

Hi @PamelaReeve27 

 

Try the compose and view the code. That will do the right expression for you to map.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Highlighted
Community Support
Community Support

Re: Invalid AttachmentName with trigger manual (mutiple file upload) and start approval

 

Hi @PamelaReeve27 ,

 

I could reproduce the same issue on my side.

Please ensure you have upload three files when you testing the flow.

This is  my test result:

8.PNG

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Community Support
Community Support

Re: Invalid AttachmentName with trigger manual (mutiple file upload) and start approval

 

Hi @PamelaReeve27 ,

 

If you want dynamically upload files, you could check the configuration of the Attachment. You could import it as a new flow and check if it helps.

import-export-bap-packages 

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Frequent Visitor

Re: Invalid AttachmentName with trigger manual (mutiple file upload) and start approval

I did try to recreate flow and finally found that once I setup manually trigger input for 'file', it requires upload file, could not leave blank even I setup as optional. I guess when I conduct trigger as attachment but file left blank. MS flow itselves can't understand so it erros. 

Thank you guys for suggestions. I may ask more as i'm beginner to MS flow.

 

BRs,

Pamela

Highlighted
Community Support
Community Support

Re: Invalid AttachmentName with trigger manual (mutiple file upload) and start approval

 

Hi @PamelaReeve27 ,

 

Yep, if you have added file input in the manual button, you need to upload files when you running the flow.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Top Kudoed Authors
Users online (8,227)