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

Change selected Gallery Items added Dropdown to Dropdown2.selected.Value

I have a Gallery where I have added 2 Inputs, 1 Checkbox and 1 Dropdown

Checkbox OnCheck : Patch(Collection,ThisItem,{IsChosen:true})

Checkbox OnUnCheck : Patch(Collection,ThisItem,{IsChosen:false})

Dropdown Items : AnotherList

Dropdown2  Items : (Which is not part of the Gallery) : AnotherList

 

So what I want is, I want to be able to press a button that would change any Dropdown that IsChosen = true to whatever is selected in Dropdown2 on the touch of a Button.

 

I have tried many many different configuration of this but it always fails. First time I select the Gallery.Items it works but afterwards it's all broken. Either it doesn't keep the Selected Value or either I only select Items with the Checkbox and they change without the press of a Button

 

 

Please help.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Change selected Gallery Items added Dropdown to Dropdown2.selected.Value

@yanni99 

I would suggest using this code within the OnSelect property of a button that is placed outside of the Gallery.

UpdateIf(
    Collection,
    IsChosen=True,
    {your_field_name: Dropdown2.Selected.Value}
)

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

10 REPLIES 10
Super User
Super User

Re: Change selected Gallery Items added Dropdown to Dropdown2.selected.Value

@yanni99 

I would suggest using this code within the OnSelect property of a button that is placed outside of the Gallery.

UpdateIf(
    Collection,
    IsChosen=True,
    {your_field_name: Dropdown2.Selected.Value}
)

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

Highlighted
Helper II
Helper II

Re: Change selected Gallery Items added Dropdown to Dropdown2.selected.Value

Thank @mdevaney for your quick reply. 

 

However, the value I want to change is not in Collection yetThe Dropdown Items are from AnotherList. I want to be able to change the Dropdown later manually if I want to. That's where my problem lies. Can't figure it out.

Highlighted
Super User
Super User

Re: Change selected Gallery Items added Dropdown to Dropdown2.selected.Value

@yanni99 

You said this: 

The value I want to change is not in Collection yet

 

Did you mean this instead?

The column I want to change is not in the collection yet

 

Highlighted
Helper II
Helper II

Re: Change selected Gallery Items added Dropdown to Dropdown2.selected.Value

Yes, this makes more sense. I want to change a dropdown to what would later be a column in my Collection. But I still want to be able to change it at will before patching it to my Collection. Does that makes sense?

 

 

Highlighted
Super User
Super User

Re: Change selected Gallery Items added Dropdown to Dropdown2.selected.Value

@yanni99

Keep in mind that a Collection must have the same columns at all places in your app.  You cannot have a Column in one place and no Column in another.

 

No, I do not understand the meaning of 'at-will'.

 

The best way to show me what you want would be to take some screenshots describing how a user will click-through the app and what the collection should look like before and after.

Highlighted
Helper II
Helper II

Re: Change selected Gallery Items added Dropdown to Dropdown2.selected.Value

Here you go, Hope this clears things up

 

ezgif.com-video-to-gif.gifezgif.com-video-to-gif (1).gif

Highlighted
Super User
Super User

Re: Change selected Gallery Items added Dropdown to Dropdown2.selected.Value

@yanni99 

Thank you for providing the GIFs.  I am still unclear about what is desired here.

 

The code I supplied is intended to make the app behave just as you showed in the video of the app playing.  Perhaps I am missing what 'is not happening' and needs to be corrected in your app.

Highlighted
Community Support
Community Support

Re: Change selected Gallery Items added Dropdown to Dropdown2.selected.Value

Hi @yanni99 ,

Do you mean that after you click a button, drop down1 will display the value of drop down2 selected and this value has not existed in drop down1's Items?

I'm afraid it's not supported now.

The value that one drop down displays could only from its data source.

If the value hasn't existed in the drop down's data source, it will not display.

For example, if the drop down's Items is: [1,2,3,4,5]

The drop down could only display 1/2/3/4/5, 6 will not display until you patch 6 into the drop down's Items.

So I suggest you firstly patch drop down2 selected value to drop down1's data source and then display the selected value in drop down1.

 

 

Best regards,

 

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Helper II
Helper II

Re: Change selected Gallery Items added Dropdown to Dropdown2.selected.Value

I used your formula but it was only solving part of my problem. 

 

What I did is, instead of using dropdowns in my gallery, I used buttons that opens a popup with all the same Items in the dropdowns and it is working great. Way easier than working with a dropdown.

 

Thank you for putting me on the right path.

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,779)