cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Guicord101
Helper III
Helper III

Problems viewing an item's details in the gallery

Hi guys!

I'm having trouble setting up a button so the user can view the details of information filled in a form

Example:

Guicord101_0-1656349828497.png

I'd like when users click on the "arrow" they would be taken to a page where they can view all the form fields they filled in, however when the user does this they get the following error:

Guicord101_1-1656349923238.png

"No items to display"
My button has the following code in the "OnSelect" function: 
Select(Parent);;Navigate(Tela_Detalhes_Clientes_Inclusao)

Tela_Detalhes_Clientes_Inclusao is the name of the screen that my detail form is on

Guicord101_2-1656350027959.png

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
jcfDaniel
Super User
Super User

Hi,

 

You need to "take the record with you".

 

Change your code to Select(Parent); Set(varSelectedRecord, ThisItem);Navigate(Tela_Detalhes_Clientes_Inclusao)

 

Then, on the form that is in Tela_Detalhes_Clientes_Inclusao set the Item to varSelectedRecord (if you are using a form). Otherwise, just drop in the controls you want and set to to varSelectedRecord.YourColumns


Regards. JD.

View solution in original post

jcfDaniel
Super User
Super User

Yes. On the form, you should also set the Datasource property to your table.


Regards. JD.

View solution in original post

14 REPLIES 14
YukonJoe
Frequent Visitor

Is your default form mode set to Edit or New? 

In the tab to fill in the form, the Default Mode is set to "Edit"

I've noticed sometimes I have to change the form mode to New and then switch it back for it to work correctly. But also, I would write in a variable for the form mode for making new ones and editing existing records.

 

I have this on my new entry Icon

 

YukonJoe_0-1656366596838.png

 

 

Set(varFormMode, Defaults('MyFormName'))

 

 

I have this bit in mine to edit a previous entry from a gallery.

 

YukonJoe_1-1656366671717.png

 

 

Select(Parent);Set(varFormMode,Gallery6.Selected);Navigate(Screen3);

 

 

You then will add that variable varFromMode to your Item for the form.

 

YukonJoe_2-1656367105138.png

 

I used this vid to help me out when I built this form. Highly recommend watching it for some of the ...

 

Good luck!

jcfDaniel
Super User
Super User

Hi,

 

You need to "take the record with you".

 

Change your code to Select(Parent); Set(varSelectedRecord, ThisItem);Navigate(Tela_Detalhes_Clientes_Inclusao)

 

Then, on the form that is in Tela_Detalhes_Clientes_Inclusao set the Item to varSelectedRecord (if you are using a form). Otherwise, just drop in the controls you want and set to to varSelectedRecord.YourColumns


Regards. JD.

it worked!! Thanks!

Hi! 
The code works for 1 gallery, however when I put the same code in the other gallery both didn't work.
What should I do?
I have to configure this same code for 3 galleries

Guicord101_1-1656601599915.png

 

 



jcfDaniel
Super User
Super User

I can't see a reason it should stop working for gallery 1 even if it doesn't work for 2 and 3.

 

All those 3 galleries are in the same screen? Why are there different id numbers?


Regards. JD.

All galleries are on the same screen.

My app has 3 forms, to save screens I chose to put the 3 galleries on the same screen. Do you think this is the cause of the error?

jcfDaniel
Super User
Super User

No, not at all. What confuses me is why you would want to have the same record in all 3 galleries, because that is what you will get if all galleries have varSelectedRecord in Items


Regards. JD.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,141)