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

PHOTO ATTACH

(0) ShareShare
ReportReport
Posted on by Super User 2024 Season 1

Hi,

 

I am trying to add each records to pictures receipt, but I don't want to use default attachment control what's the best way to do it please and my data source is SharePoint , also can you tell what's formula to use on PowerApps and to attached to records from PowerApps

 

 

thumbnail_Screenshot 2020-06-28 at 10.50.43 AM.png

 

Thanks   

Categories:
I have the same question (0)
  • KrishnaV Profile Picture
    5,023 on at

    Hi @Ramole ,

     

    See the below video explaining uploading pictures to the SharePoint library step by step using Add Picture control explained by a reputed PowerApps MVP @RezaDorrani .

     

    https://youtu.be/5XsWgVnR7SU


    I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

    Regards,
    Krishna
    If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.

  • Ramole Profile Picture
    Super User 2024 Season 1 on at

    Hi @KrishnaV 

     

    Thanks for sharing the link but i would like example i have SharePoint list not document and i would like to add a image field and that allows me to uploaded with with my data, 

    Thanks

  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Ramole ,

    Where do you want to store the attached images? SP List or SP Library?

    Do you want to upload image files without using Attachments control in your app?

     

    Based on the needs that you mentioned, I think the "Add Picture" control could achieve you needs.

    1) If you want to save images into a SP Library, you could consider save your images attached in your app back to your SP Library, and bind these uploaded images in your SP Library to the created SP List Item through a custom column (e.g. Add a Custom column in your SP Library to store the List Item ID of your created SP List Item) in your SP Library.

    Please check and see if the following video resource could help in your scenario:

    https://www.youtube.com/watch?v=kQVYid1p_vA

    https://www.youtube.com/watch?v=ZXWyDgDEHPo

     

    2) If you want to save images back to your SP List

       (a). If just want to attach single one image file to each created SP List Item, I think a "Multiple Lines of Text" type column in your SP List could achieve your needs. Please check the following thread solution for more details:

    https://powerusers.microsoft.com/t5/Building-Power-Apps/Uploading-images-to-SharePoint-list-without-using-Flow/td-p/482731

    On your side, you could consider add a "Multiple Lines of Text" type column in your SP List to store the captured image data from your canvas app.

    In your app, add a "Add Picture" control, set the OnChange property to following:

    Collect(ImageCollection, Substitute(JSON(UploadedImage1.Image, JSONFormat.IncludeBinaryData),"""", ""))

    If you use SubmitForm function to submit data back to your SP List, please consider set the OnSuccess property of the Edit form to following:

    Patch(
     'Your SP List',
     EditForm1.LastSubmit,
     {
     MultipleLinesTextField: First(ImageCollection).Value // Save the attached image back to the Multi-Lines Text column in your SP List
     }
    );
    Clear(ImageCollection); // Clear the ImageCollection
    Back()

    Then the image data would be stored in your SP List as below:

    10.JPG

    When you want to preview the store the image data in your canvas app, please consider add a image control in your Detail Screen, set the Image property of the Image control to following:

    BrowseGallery1.Selected.MultipleLinesTextField

      (b). Of course, you could also consider use the "Multiple Lines of Text" column to store multiple images data attached from the "Add Picture" control. On your side, you just need to modify Patch formula in OnSuccess property of Edit form as below:

    Patch(
     'Your SP List',
     EditForm1.LastSubmit,
     {
     MultipleLinesTextField: Concat(ImageCollection, Value & "&") // Modify formula here
     }
    );
    Clear(ImageCollection); // Clear the ImageCollection
    Back()

    Then when you want to preview these stored image data in your canvas app, please consider add a Gallery control in your Detail Screen, set the Items property to following:

    Filter(
     Split(BrowseGallery1.Selected.MultipleLinesTextField, "&"),
     !IsBlank(Result)
    )

    Add a Image control in this Gallery, set the Image property to following:

    ThisItem.Result

    Note: I think the second solution may be better for your scenario.

     

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

     

    Best regards, 

  • Ramole Profile Picture
    Super User 2024 Season 1 on at

    Hi @v-xida-msft 

     

    Its SharePoint List 

    I will try i will let you. that reason i need is i patch my data ForAll collection as i didnt see a way to use attachment control on patch, secondly it will be better to upload multiple photo at one time on one record thats what i am trying to do.

     

    Thanks 

  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Ramole ,

    Sure, please take a try with the second solution I provided above, check if it could help in your scenario.

     

    Best regards,

  • Ramole Profile Picture
    Super User 2024 Season 1 on at

    Hi @v-xida-msft 

     

    Collect(ImageCollection, Substitute(JSON(UploadedImage1.Image, JSONFormat.IncludeBinaryData),"""", "")) 


    do i need to add anything on ,"""", ""))  ?

  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Ramole ,

    No, just remain it there. The formula I provided above is complete, you just need to replace the Multiple Lines Text column name with actual column name from your SP List😄.

     

    Regards,

  • Ramole Profile Picture
    Super User 2024 Season 1 on at

    Hi @v-xida-msft 

     

    One last thing how can i download when i click the image from the app please 

     

    Thanks

  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Ramole ,

    Do you want to download the image when you click the Image control?

    Is the solution helpful for your original issue?

     

    If the solution I provided above is helpful for your original issue, please consider go ahead to click "Accept as Solution" to identify my reply as helpful.

     

    If you want to download the image when you click the Image control, I afraid that the "Multiple Lines of Text" column solution could not achieve your needs.

     

    Currently, if you want to download a file from a canvas app, you need to use the Download function or through Attachments control. But the argument of the Download function is required to provide a URL Address of the file you want to download. You could not download a base64 encoded image data as a image file from canvas app directly.

     

    As an possible solution, you need to store the image data as a image file in your SP Library, then you could use the Download function to download the image file based on the URL Address of the stored image file. Or you could achieve your needs using Attachments control in your Edit form.

     

    Best regards,

  • Ramole Profile Picture
    Super User 2024 Season 1 on at

    Hi @v-xida-msft 

     

    solution 2 worked, download i mean when i click the image to open ?

     

    Thanks 

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 329 Most Valuable Professional

#2
11manish Profile Picture

11manish 209 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 179

Last 30 days Overall leaderboard