web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Attaching File to Shar...
Power Apps
Answered

Attaching File to SharePoint List Item

(1) ShareShare
ReportReport
Posted on by 160
I am trying to attach files to a SharePoint list item but I keep getting an error message that says file name is required.
 
My code is below. I have used this approach before without error but this time it's not working.
 
The workflow works when running it manually and attaching a file right at the workflow.
 
ForAll(attNewRequestAttachments.Attachments As _attachment,
    ITRequestAddTicketAttachments.Run(
        Value(7),
        {
            contentBytes: _attachment.Value,
            name: _attachment.Name
        }
    )
);
 
Here is my Power Automate configuration
 
 
Here is the error in the workflow
 
Categories:
I have the same question (0)
  • Verified answer
    Kalathiya Profile Picture
    2,456 Super User 2026 Season 1 on at
     
    This error "Value must be provided in file name" usually means that the SharePoint Add attachment action is not receiving a file from Powerapps, it's empty due to this you are getting the error:
     
    Issue is that the flow expects a file object, but the file properties are being passed directly due to this file is passing empty in automate.
     
    Try passing the file parameter like this:
    ForAll(attNewRequestAttachments.Attachments As _attachment,
        ITRequestAddTicketAttachments.Run(
            Value(7),
            {
               file:{ 
                       contentBytes: _attachment.Value,
                       name: _attachment.Name
                     }
            }
        )
    );
    Reference link: 
     
    ---------------------------------------------------------------------------
    Glad it helped 🙂
    If this fixed your issue,
    please click “Does this answer your question?” to mark it as verified so others can find the solution easily.
    A Like 👍 is always appreciated, and I’m around if you need more help @Kalathiya
  • Suggested answer
    Pstork1 Profile Picture
    69,556 Most Valuable Professional on at
    Your trigger is configured to ask for the ID of the item and the filename.  But your ForAll is passing the file name and the content bytes.  You are passing the wrong parameters.

    ----------------------------------------------------------------------------------
    If this Post helped you, please click "Does this answer your question" and give it a like to help others in the community find the answer too!

    Paul Papanek Stork, MVP
    Blog: https://www.dontpapanic.com/blog
     
  • FW-07051511-0 Profile Picture
    160 on at
     
    That fixed it. Thank you.

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 424

#2
WarrenBelz Profile Picture

WarrenBelz 355 Most Valuable Professional

#3
11manish Profile Picture

11manish 290

Last 30 days Overall leaderboard