cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
moltenlava
Level: Powered On

Display form not showing correct gallery item selected

Hi All,

 

I have no clue where to go from here so would really appreciate the help!

I am working on an app where, very simply, there is a gallery that is filtered to only show items that you have created, when you click a gallery item it goes to a display form that also then shows you an edit button which, when clicked on, takes you to an edit form. 

 

When i click the gallery item, it always only shows the first item i click in the display form but when i go back never "refreshes" to show the new item.

 

For example, i have Item A, B and C:

- In browsegallery screen named "your workshops" i click item A

- in display screen, it shows item A in the display form

- When i click edit screen, it shows item A to edit

- Click back to browsegallery screen names "your workshops" and click item B

- in display screen, it shows item A in the display form??

- When i click edit screen, it shows item B to edit

 

Im not sure why it just doesnt work for the display screen and only works first time. I have been using context variables after finding out that browsegallery.selected also didnt work.

 

Screenshots attached of formulas used (had to blur out content) and any help will be greatly appreciated!!

1 ACCEPTED SOLUTION

Accepted Solutions
sopatte
Level 8

Re: Display form not showing correct gallery item selected

I think you need to reset the form, possibly in OnSelect of your "close" icon, to make the controls revert to their default values.

5 REPLIES 5
Super User
Super User

Re: Display form not showing correct gallery item selected

I like setting a global variable best for this:

 

instead of Navigate('Workshop Information',None, {displayitem:ThisItem})

 

put 

 

Navigate('Workshop Information,None);Set(varDisplayItem,ThisItem.Title)

 

And then on the Item for the form put 

 

LookUp('Workshop Information',Title=varDisplayItem)

 

Other option is taking out that {displayitem:ThisItem} on the gallery and just simply making the Item on the form:

 

Gallery1.Selected

 

But I like the Set best because you can refer to it several places and it is more consistant on pulling the correct data.

sopatte
Level 8

Re: Display form not showing correct gallery item selected

I think you need to reset the form, possibly in OnSelect of your "close" icon, to make the controls revert to their default values.

moltenlava
Level: Powered On

Re: Display form not showing correct gallery item selected

Hi rebeccas,

 

Ive tried the gallery.selected route but i still get the issue where the wrong item is shown in the "display mode" form, but shows the right one in the "edit form" mode. Its weird cause this all works in the preview its just as soon as i publish the published version doesn't work!

 

I started doing the global variable option you said below but came up with a red squiggly line under : LookUp('Workshop Information',Title=varDisplayItem) it doesn't seem to like the 'Workshop Information' bit. When i change the source to the sharepoint list source it just shows any old random item from the list and not the filtered one i selected in the gallery.

 

Any further help would be really appreciated!

moltenlava
Level: Powered On

Re: Display form not showing correct gallery item selected

Hi Sopatte,

 

Amazing thank you!! this worked! It seemed i just needed to reset form when i click the navigation button to the display form!

 

Thank you!

Super User
Super User

Re: Display form not showing correct gallery item selected

What I would suggest on the LookUp part to get it to work is don't try and just type it in.

 

* Put just your data source and make sure it works

* Then click to the left of it and put the LookUp(

* click to the right of it and put the    ,YourColumnName=varDisplayItem)

 

Make sure on the Set you have the same column name as the LookUp. It doesn't have to be Title, that is just what I use most often but you can put whatever one you want to use...just make sure you refer to the same one in both places.

 

Also, as a little test on the second screen put a text box and make it varDisplayItem.Text and make sure it is pulling the right field that you selected. That way you know if it is the Set or LookUp that isn't working right.

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

PowerApps Monthly Community Call

Next Wednesday, September 18th at 8am PDT

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 268 members 4,764 guests
Please welcome our newest community members: