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:
I have the same question (0)
  • 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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 519 Most Valuable Professional

#2
11manish Profile Picture

11manish 489

#3
Haque Profile Picture

Haque 327

Last 30 days Overall leaderboard