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 / Attach file from OneDr...
Power Apps
Unanswered

Attach file from OneDrive to SharePoint List Item though PowerApps

(0) ShareShare
ReportReport
Posted on by 69

I have an app where employees need to upload files to specific list items in SharePoint. Everything works well however, we have a problem where not all of our employees have local computers they just have their Microsoft Login and store their files on their OneDrive for Business. How do I have my Attachment Control point to the current user's OneDrive instead of the local computer? I've tried setting up a Power Automate work around but that doesn't work.

Categories:
  • Hassan_SZ_365 Profile Picture
    542 on at

    Hi @Acruz5 ,

    Follow These steps:

    1. Use OneDrive Connector:

      • Leverage the OneDrive for Business connector in PowerApps to access files stored in users' OneDrive.
    2. Collect File Information:

      • Create a collection in PowerApps to store the file information (e.g., name, link).
    3. Attachment Control Properties:

      • Set the properties of the Attachment control to point to the OneDrive file using the collected information.
    4. Power Automate (Optional):

      • If necessary, you can use Power Automate to automate the process, triggered by a PowerApps button, for a more seamless integration.

    Here's a simplified example of Power Automate:

    Trigger: PowerApps Button
    
    Get file content using path
     - Path: concat('/drives/', 'your-onedrive-drive-id', '/items/', 'file-id', '/content')
     - Output: File Content
    
    Create file in SharePoint
     - Site Address: Your SharePoint Site URL
     - Folder Path: 'your-list-name'/'list-item-id' # Adjust as per your SharePoint structure
     - File Name: 'file-name'
     - File Content: File Content

    Ensure that 'your-onedrive-drive-id', 'file-id', 'your-list-name', and 'list-item-id' are replaced with the actual IDs and names in your environment.

     

    Best Regards,

    Hassan Raza

  • Acruz5 Profile Picture
    69 on at

    I tried that but I must not know what to put in the call in the PowerApps. I'm having users click on a button to trigger the flow but it shows the helper text is Run(Addattachment_id, Addattachment_Filecontent). But I don't know what to put there. 

    AttachedFileFromOneDrive.Run(????)

  • Acruz5 Profile Picture
    69 on at

    I have a variable getting the ID of the record I want to place this attachment on. So I do have that much but what do I put for the file content? I am confused. 

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 248 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 192 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard