cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Addding file as attachments to list object

Hi,

So, I have a flow that users can start manually and, as an input parameter, they can select a file. I guess the english name on the trigger would be "On selected object" and Filinnehåll is File content in english.

On selected object.PNG

 

Now I want to add this file as an attachment to the selected object. 

 

Add attachment.PNG

 

How do I get the uploaded filename with file extension so that I can use it as Filnamn (File name in english). I feel as if I'm missing something obvious here. The Flow is more complex than this but since I have the other parts working I removed them from this example.

//Mattias

1 ACCEPTED SOLUTION

Accepted Solutions
v-zhos-msft
Level 10

Re: Addding file as attachments to list object

Hi @Anonymous ,

Thanks for your feedback.

You can use the expression to get the file name.

I have made a flow for your scenario, please check it for a reference.

The expression in 'Compose' is: triggerBody()?['file']?['name']
Capture7.PNG

Best Regards,

Community Support Team _ Zhongys

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

4 REPLIES 4
Highlighted
v-zhos-msft
Level 10

Re: Addding file as attachments to list object

Hi @Anonymous ,

It seems you want to add attachment to a sharePoint list.

You want to get the file name from the trigger. 

I have made a flow for your scenario, please check it for a reference.

Capture5.PNG

Best Regards,

Community Support Team _ Zhongys

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

 

Anonymous
Not applicable

Re: Addding file as attachments to list object

I don't have my file in SharePoint. What I have is a SharePoint list with list objects. On that object I want to start a Flow (manually). As one of the input parameters on that Flow I want to upload a file from my computer.

User input file.PNG

The file I upload should then be added as an attachment to my list object. I know how to add the attachment but I cant figure out how to get the uploaded file name in Flow. I can't use static file names since I do not know what kind of files my users will upload.

 

Regards

Mattias

v-zhos-msft
Level 10

Re: Addding file as attachments to list object

Hi @Anonymous ,

Thanks for your feedback.

You can use the expression to get the file name.

I have made a flow for your scenario, please check it for a reference.

The expression in 'Compose' is: triggerBody()?['file']?['name']
Capture7.PNG

Best Regards,

Community Support Team _ Zhongys

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

Anonymous
Not applicable

Re: Addding file as attachments to list object

Thanks, works perfectly Smiley Happy

//Mattias

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 179 members 6,346 guests
Please welcome our newest community members: