cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Ali_Nawaz
Level: Powered On

Save images as attachment in SQL

Hi PowerUsers, 

I am looking for a way to store image as attachment in SQL through powerapps. 
I am aware of the fact that CDS provides attachment feature but currently I am using SQL as database and need to store the image in it. 

The scenario is to insert a record in SQL of sick leave and attach medical certificate(image) as an attachment to it.
Can this be taken care of within PowerApps or even attaching flow with it ? 

The idea is to use SQL only. 

Looking for a usual helpful response.

Best Regards,
Ali Nawaz

3 REPLIES 3
Microsoft v-siky-msft
Microsoft

Re: Save images as attachment in SQL

@Ali_Nawazplease check the following steps.

1. Create a new column that is an image type in a new table or existing table in SQL server

2. Add a AddPicture control in PowerApps

3. Add a Button, and set OnSelect property as below:

Patch(
    '[dbo].[test]',
    Defaults('[dbo].[test]'),
    {
        ID: 1,
        Image: UploadedImage1.Image
    }
)

Snipaste_2020-01-10_11-33-05.pngthe left is a gallery within a image control to display the sql table

Sik

Microsoft v-siky-msft
Microsoft

Re: Save images as attachment in SQL

@Ali_Nawazplease check the following steps.

1. Create a new column that is an image type in a new table or existing table in SQL server

2. Add a AddPicture control in PowerApps

3. Add a Button, and set OnSelect property as below:

 

 

Patch(
    '[dbo].[test]',
    Defaults('[dbo].[test]'),
    {
        ID: 1,
        Image: UploadedImage1.Image
    }
)

 

 

Snipaste_2020-01-10_11-33-05.pngthe left is a gallery within an image to display the sql table

Sik

Ali_Nawaz
Level: Powered On

Re: Save images as attachment in SQL

Hi, @v-siky-msft 

The issue with this control is when we submit an image through it we can not read back the image once the session is expired. 
I had a ticket locked with Microsoft support engineer and he told me that in Powerapp somehow to read back (see) the image, Azure blob storage is used and it only displays the image temporarily(session dependent). 
I had the incident where I could only read the last (latest) stored image in the PowerApp gallery, rest of the images were not visible at all. 

If you can help us in reading back the image (displaying all stored images in gallery) it would be a great. 

Best Regards, 
Ali Nawaz

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

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
Users online (5,184)