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 Platform Community / Forums / Power Apps / Drop Down value remove...
Power Apps
Answered

Drop Down value removed when taking a picture

(0) ShareShare
ReportReport
Posted on by 383

Hi Power Apps Community

Scenario: A user may select an option from the drop down control in a Gallery. A user may also take a picture of the item from the Gallery using the Camera control

Issue: When I select to take a picture, the value which was selected in the drop down control gets removed.

Note: Using the AddColumns function, I have added the Collection - which stores the image taken in Power Apps, to the SharePoint List which is used to reference the Gallery.

When I remove the AddColumns function and select the same button which captures the image, then everything seems to work fine. However, this means that no image is taken. 

I have tried to re-publish the app, but that does not work

ImageExample.JPG

I would really appreciate any assistance on this.

Thank you in advance.

Categories:
I have the same question (0)
  • Data_Enthusiast Profile Picture
    383 on at

    I would like to mention that I have tested this with other controls such as Text Input, Combo Box, Date Picker... as soon as I take a picture with the Camera control, all the values which were added in the above controls were removed. 

  • WarrenBelz Profile Picture
    155,585 Most Valuable Professional on at

    Hi @Data_Enthusiast ,

    Firstly, I am assuming you are Patching the camera output to a multi-line text field in the SharePoint list?
    Secondly is the drop-down bound to anything in the collection the gallery is based on?

    Can you also give me the Collect code for forming this.

  • Data_Enthusiast Profile Picture
    383 on at

    Hi @WarrenBelz 

    I tried to Patch to a multi-line text field (plain text), but the value patched to the SP List was blank.

    I don't believe the Drop Down is bound to anything in the Collection. The Items property has ["", "Yes", "No"] as item values. And the OnSelect property has Select(Parent).

    I am using a button to capture the image: Collect(CameraPhoto, {Photo: Camera2_4.Stream, FileName: Title3.Text});

  • WarrenBelz Profile Picture
    155,585 Most Valuable Professional on at

    Hi @Data_Enthusiast ,

    First item - this code

    Collect(
     CameraPhoto, 
     {
     Photo: Camera2_4.Stream, 
     FileName: Title3.Text
     }
    )

    will add a photo to the Collection CameraPhoto each time the control is selected. If you only want the latest photo, you should use ClearCollect, but that is not the main question. Can you please supply the Patch you are using to write the data to to the SharePoint field?

    Second point - now you have confirmed the drop-down is not bound to anything, I can tell you that it resets when a Patch is done from a gallery - have a read of this post of mine - I will tackle this one next, but you will need to be working in a Collection in the Gallery.

  • Data_Enthusiast Profile Picture
    383 on at

    Hi @WarrenBelz 

    Yes, I am wanting to collect a group of photos and not the latest.

    Ohh yes you are correct, I am using a Patch function on the OnChange property of the Drop Down - which is where the reset is happening. 

    I had to perform a Patch on this control because of this: https://powerusers.microsoft.com/t5/Building-Power-Apps/Unable-to-update-individual-Gallery-item-using-UpdateContext/m-p/547023#M168303 - my previous post about an issue I had. 

    The Patch function used for the image is: Patch('SP List', Defaults('SP List'), {Title: Title3.Text, ImageTaken: First(CameraPhoto).Photo});

    Note: This means that there are two Patch functions happening on the same page, but patching to two different SP Lists.

    *Currently going through the post you have shared

  • Data_Enthusiast Profile Picture
    383 on at

    Hi @WarrenBelz 

    Yes, I am wanting to collect a group of photos and not the latest.

    Ohh yes you are correct, I am using a Patch function on the OnChange property of the Drop Down - which is where the reset is happening. 

    I had to perform a Patch on this control because of this: Unable to update individual Gallery item - my previous post about an issue I had. 

    The Patch function used for the image is: Patch('SP List', Defaults('SP List'), {Title: Title3.Text, ImageTaken: First(CameraPhoto).Photo});

    Note: This means that there are two Patch functions happening on the same page, but patching to two different SP Lists.

    *Currently going through the post you have shared

  • WarrenBelz Profile Picture
    155,585 Most Valuable Professional on at

    Thanks @Data_Enthusiast ,

    Firstly try this on the Patch

    Patch(
     'SP List', 
     Defaults('SP List'), 
     {
     Title: Title3.Text, 
     ImageTaken: First(CameraPhoto).Url
     }
    )

    I will firstly say you can only store one photo in that field, so this will be the first one taken. As mentioned earlier, if you use ClearCollect on the photo, it will get the last one (as there is only one)
    Second issue - did you read the other post and understand the issue? For this not to reset (it actually does, but you bind it to the same value), the gallery needs to be from a Collection and you need to add a field to it to Patch the output of the drop-down, so when it resets, it shows the value you have patched.

     

  • Data_Enthusiast Profile Picture
    383 on at

    Hi @WarrenBelz 

    I sort of see what is happening in your linked post. 

    However, I am already performing an AddColumns function for the photo to be associated to each Gallery item. 

    Is it possible to perform two AddColumns in the same function?

  • Data_Enthusiast Profile Picture
    383 on at

    Hi @WarrenBelz 

    With regards to the Patch function, this is still the same script which I used. The 'Url' column is named 'Photo' on my side. Which is why I referenced is as:

    Patch(
     'SP List', 
     Defaults('SP List'), 
     {
     Title: Title3.Text, 
     ImageTaken: First(CameraPhoto).Photo
     }
    )

    I am still getting a blank entry in the SP List 😞 

  • Verified answer
    WarrenBelz Profile Picture
    155,585 Most Valuable Professional on at

    Hi @Data_Enthusiast ,

    Yes, you have changed it in the collect.

    Try this on the Camera OnSelect - i have used the same syntax to send over 30,000 photos to a Flow to store them in a Library. It produces Text in a format called dataUri, which can also be stored in a SharePoint Multi-line Text field. There is no need to store the name twice.

    ClearCollect(
     CameraPhoto,
     Camera2_4.Photo
    )

    Then on the Patch

    Patch(
     'SP List', 
     Defaults('SP List'), 
     {
     Title: Title3.Text, 
     ImageTaken: First(CameraPhoto).Url
     }
    )

    To test the theory, put a label on the screen - make it a good size with the Text First(CameraPhoto).Url (note the case) and see if it has text in it when you take a photo.

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 404

#2
timl Profile Picture

timl 344 Super User 2026 Season 1

#3
WarrenBelz Profile Picture

WarrenBelz 320 Most Valuable Professional

Last 30 days Overall leaderboard