cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper III
Helper III

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
Highlighted
Community Support
Community Support

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
    }
)

the left is a gallery within a image control to display the sql tablethe left is a gallery within a image control to display the sql table

Sik

Highlighted
Community Support
Community Support

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
    }
)

 

 

the left is a gallery within an image to display the sql tablethe left is a gallery within an image to display the sql table

Sik

Highlighted
Helper III
Helper III

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
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,935)