cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Vote with a Drop Down within a Gallery

Hello Community,

 

I am having a weird glitch in my app and I am hoping I can get some help here.

I have a Power App that a committee uses to vote on changes to documents. The committee leader chooses a document from a drop down list and a gallery appears for voting. The gallery has one tile per committee member with a drop down ["","Yes","No"]:

Votes Gallery.png

 

 

The application then patches the votes to SharePoint List text columns. If a committee member is not present in the meeting, the vote for that role is disabled. The documents that don't have all the votes recorded can be brought up in subsequent meetings and edited so that the voting can be completed. 

The problem that I have is when the gallery brings up the votes from an existing record. The collection that contains the votes has the correct records from the SP List. I have the "Default" value for the drop down set as "ThisItem.Vote". However, the default value reflected for every member is whatever the first vote reads instead of the votes for each member like the collection has.

 

I hope someone can point out what I'm missing!

 

Thanks!

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hello!

 

Aha, so you mean that in the Collection, the datasource of your gallery, you have one record per committee member?

 

Still not sure the exact problem but I have seen similar problems myself. I have noticed that dropdowns in galleries sometimes caches the values and that the Default values is overwritten by that. Have you tried to "Reset" the dropdowns? If no, try to add this formula on a button, or maybe the OnVisible property of the screen (whatever suits you best)

UpdateContext({ResetVar: true});UpdateContext({ResetVar: false})

 

Then, on the Reset property of your dropdown put:

ResetVar

 

This will force a reset of the control to Default value. Hope this helps!

 

BR

Pontus

View solution in original post

4 REPLIES 4
Resolver IV
Resolver IV

Hi!

 

Hard to tell without all the facts, but I suppose that one document = one record in the SP list? And that every committee member has one column in that record? In that case, I think that the default value "ThisItem.Vote" is wrong. Or you could at least not have that as default for all dropdowns since that will give you the same value. Shouldn´t it be like "ThisItem.LeadPersonVote", "ThisItem.ProjectManagerVote" etc?

 

BR

Pontus

Anonymous
Not applicable

Hi @pontusofsweden !

 

You are correct: 1 document = 1 record in SP list, and each committee member has a column in the list. However, to put it in the gallery, I had to create a collection with 2 columns: Role and Vote. If instead of the drop down, I have a label where the text is ThisItem.Vote, it works fine. 

 

I hope this detail helps clarify.

 

Thanks!

 

Blanca

Hello!

 

Aha, so you mean that in the Collection, the datasource of your gallery, you have one record per committee member?

 

Still not sure the exact problem but I have seen similar problems myself. I have noticed that dropdowns in galleries sometimes caches the values and that the Default values is overwritten by that. Have you tried to "Reset" the dropdowns? If no, try to add this formula on a button, or maybe the OnVisible property of the screen (whatever suits you best)

UpdateContext({ResetVar: true});UpdateContext({ResetVar: false})

 

Then, on the Reset property of your dropdown put:

ResetVar

 

This will force a reset of the control to Default value. Hope this helps!

 

BR

Pontus

View solution in original post

Anonymous
Not applicable

It  worked!! I had a feeling that it had something to do with cached memory but I had no idea of why or how to fix it! thanks so much @pontusofsweden!!

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

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