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

Upload Attachments to SharePoint Document Library Based on DataCard Value

Hi, I would like to upload attachments to my SharePoint's document library based on the datacard value in PowerApps.

 

For instance, when the users select "Module 07" and attach a file and submit the form, the attached file will be uploaded to the document library named "Module 07".

 

Can anyone help me with this? Thank you!

 

PowerApps.JPGSharePoint.JPG

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Upload Attachments to SharePoint Document Library Based on DataCard Value

Hi @Anonymous ,

Could you please share a bit more about your scenario?

Do you want to upload a file from your canvas app into your SP Library? How do you upload this attached files within your app? Fire a flow (Microsoft Flow) to upload this attached file into your SP Library?

 

Currently, within PowerApps, there is no direct way to upload files from a canvas app to a SP Library. As an alternative solution, I think the combination of PowerApps and Microsoft Flow could achieve your needs.

I assume that your Edit form (in your canvas app) connects to a SP list (e.g. List1) on your side, and you use "Attachments" control to upload files, is it true?

On your side, you could consider take a try to create a flow to detect if there is an item created in your List1, if yes, get the correspoding attachment files from this new added item, then save them into corresponding SP Library based on the Module 车号 field value.

 

I have made a test on my side, please take a try with the following workaround:

My App's configuration as below:2.JPG

 

My Flow's configuration as below:3.JPG

 

4.JPG

Within the "Create file" action, Folder Patch field set to following formula (type the following formula manually😞

/MyLibrary/Module 车号 Value Dynamic content of the trigger    /* <-- MyLibrary represents my SP Library name */

On your side, you should type:

/YourSPLibrary/Module 车号 Value Dynamic content of the trigger 

More details about get the Module 车号 Value dynamic content of the trigger within the Folder Path field, please check the following GIF screenshot:Test.gif

The flow works successfully as below:5.JPG

 

6.JPG

Please take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
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

5 REPLIES 5
Community Support Team
Community Support Team

Re: Upload Attachments to SharePoint Document Library Based on DataCard Value

Hi @Anonymous ,

Could you please share a bit more about your scenario?

Do you want to upload a file from your canvas app into your SP Library? How do you upload this attached files within your app? Fire a flow (Microsoft Flow) to upload this attached file into your SP Library?

 

Currently, within PowerApps, there is no direct way to upload files from a canvas app to a SP Library. As an alternative solution, I think the combination of PowerApps and Microsoft Flow could achieve your needs.

I assume that your Edit form (in your canvas app) connects to a SP list (e.g. List1) on your side, and you use "Attachments" control to upload files, is it true?

On your side, you could consider take a try to create a flow to detect if there is an item created in your List1, if yes, get the correspoding attachment files from this new added item, then save them into corresponding SP Library based on the Module 车号 field value.

 

I have made a test on my side, please take a try with the following workaround:

My App's configuration as below:2.JPG

 

My Flow's configuration as below:3.JPG

 

4.JPG

Within the "Create file" action, Folder Patch field set to following formula (type the following formula manually😞

/MyLibrary/Module 车号 Value Dynamic content of the trigger    /* <-- MyLibrary represents my SP Library name */

On your side, you should type:

/YourSPLibrary/Module 车号 Value Dynamic content of the trigger 

More details about get the Module 车号 Value dynamic content of the trigger within the Folder Path field, please check the following GIF screenshot:Test.gif

The flow works successfully as below:5.JPG

 

6.JPG

Please take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
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: Upload Attachments to SharePoint Document Library Based on DataCard Value

Hi, thank you for your reply. I have done the flow which you suggested but when I upload the files, the files will appear in my SharePoint list under "Attachments" but not in my SharePoint library.

 

I have attached screenshots of the flow as I don't know where I am doing wrong. Can you help me with this? Thank you!

 

Flow 1.JPGFlow 2.JPG

Community Support Team
Community Support Team

Re: Upload Attachments to SharePoint Document Library Based on DataCard Value

Hi @Anonymous ,

Based on the screenshot that you provided, I think there is something wrong with your flow's configuration?

 

Please consider remove the "PowerApps" trigger button from your flow, use the "When an item is created" trigger as the trigger of your flow.

Note: Do Not use "PowerApps" trigger button as the trigger of your flow.

When you add a new item into your OPL Tracking SP List through your app, the "When an item is created" trigger of your flow would be fired.

 

Please check the Run History of your flow, to make sure that your flow has been executed successfully.

 

Best regards,

Community Support Team _ Kris Dai
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: Upload Attachments to SharePoint Document Library Based on DataCard Value

Hi, I tried to remove the PowerApps trigger button but after I did that, I cannot find the flow in my PowerApps anymore. 

Highlighted
Anonymous
Not applicable

Re: Upload Attachments to SharePoint Document Library Based on DataCard Value

Hi, thank you very much for your reply. I have understood what you meant and I think the flow you suggested is working but I can't seem to upload the files as I have some access issues which I will solve.

 

Thank you once again!

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 292 members 5,893 guests
Please welcome our newest community members: