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

Submitting multiple images on the same form and permanently storing these into a SQL database

Morning,

 

I'm wanting to story mutilple images on the same form, uploading them into a SQL Database, then allowing any users to view these images. Can someone help me?

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Submitting multiple images on the same form and permanently storing these into a SQL database

Hi @Anonymous,

 

Could you please share a bit more about your scenario?

Could you please share a screenshot about your app's configuration?

Further, how do you store/upload multiple images on the same form within your app? Do you want to upload multiple images into your SQL table once time?

 

Currently, there is no direct way to upload multiple images into a SQL table once time wihtin PowerApps. As an alternative solution, you could consider take a try with the follownig workaround:

 

I have create a SQL Table on my side, the data structure as below:1.JPGNote: The BlobData column is a Image type column in my SQL table. The FileName column is the Primary key in my SQL table. Please also make sure that there is primary key within your SQL table.

 

  • Create a Image type column within your SQL Table to store the uploaded images.
  • Add a Add Picture control and a "Add Pic" button control within your form, set the OnSelect property of the "Add Pic" button to following formula:
Collect(UploadPics,{Name:Now()&CountRows(UploadPics)&".jpg",Url:AddMediaButton1.Media})
  • Add a "Upload Into SQL Table" button within your form, set the OnSelect property of the "Upload into SQL Table" button to following formula:
ForAll(UploadPics,Patch('[dbo].[TestBlobUpload]',Defaults('[dbo].[TestBlobUpload]'),{FileName:Name,BlobData:Url}))

2.JPG

 

3.JPG

 

Please check and see if the following blog would help in your scenario:

https://powerapps.microsoft.com/en-us/blog/upload-files-from-powerapps-to-sql-server/

 

In addition, you could also consider take a try to add a Camera control (Camera1) instead of the Add picture control within your form, set the OnSelect property of the Camera control to following formula:

Collect(UploadPics,{Name:Now()&CountRows(UploadPics)&".jpg",Url:Camera1.Photo})

Set the OnSelect property of the "Upload into SQL Table" button to following formula:

ForAll(UploadPics,Patch('[dbo].[TestBlobUpload]',Defaults('[dbo].[TestBlobUpload]'),{FileName:Name,BlobData:Url}))

 

 

Best regards,

Kris

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

2 REPLIES 2
Community Support Team
Community Support Team

Re: Submitting multiple images on the same form and permanently storing these into a SQL database

Hi @Anonymous,

 

Could you please share a bit more about your scenario?

Could you please share a screenshot about your app's configuration?

Further, how do you store/upload multiple images on the same form within your app? Do you want to upload multiple images into your SQL table once time?

 

Currently, there is no direct way to upload multiple images into a SQL table once time wihtin PowerApps. As an alternative solution, you could consider take a try with the follownig workaround:

 

I have create a SQL Table on my side, the data structure as below:1.JPGNote: The BlobData column is a Image type column in my SQL table. The FileName column is the Primary key in my SQL table. Please also make sure that there is primary key within your SQL table.

 

  • Create a Image type column within your SQL Table to store the uploaded images.
  • Add a Add Picture control and a "Add Pic" button control within your form, set the OnSelect property of the "Add Pic" button to following formula:
Collect(UploadPics,{Name:Now()&CountRows(UploadPics)&".jpg",Url:AddMediaButton1.Media})
  • Add a "Upload Into SQL Table" button within your form, set the OnSelect property of the "Upload into SQL Table" button to following formula:
ForAll(UploadPics,Patch('[dbo].[TestBlobUpload]',Defaults('[dbo].[TestBlobUpload]'),{FileName:Name,BlobData:Url}))

2.JPG

 

3.JPG

 

Please check and see if the following blog would help in your scenario:

https://powerapps.microsoft.com/en-us/blog/upload-files-from-powerapps-to-sql-server/

 

In addition, you could also consider take a try to add a Camera control (Camera1) instead of the Add picture control within your form, set the OnSelect property of the Camera control to following formula:

Collect(UploadPics,{Name:Now()&CountRows(UploadPics)&".jpg",Url:Camera1.Photo})

Set the OnSelect property of the "Upload into SQL Table" button to following formula:

ForAll(UploadPics,Patch('[dbo].[TestBlobUpload]',Defaults('[dbo].[TestBlobUpload]'),{FileName:Name,BlobData:Url}))

 

 

Best regards,

Kris

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: Submitting multiple images on the same form and permanently storing these into a SQL database

Sorry Kris I've been away.

I've worked out how to do this, very similar to what you have shown.

Thanks for the help!

Helpful resources

Announcements
thirdimage

Power Apps 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

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (5,352)