cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Creating Details screen based on subgallery

Hi everyone, 

 

I am creating a PowerApp for inventory management especially for clothes.

For each size there is an item in my SharePoint list. So, I created a Gallery witch groupes the clothes by their category and in the sub gallery the user will see the different sizes

But now I can’t figure out how to create a form/ detail screen for the selected Item of the Sub gallery so I can build something like a shopping cart.  

In an another Tread I found this:

"Set the context variable to be the unique identifier of the selected item in your subgallery - this would be something like:

Navigate(scnViewOrderHeader, ScreenTransition.Fade, {varOrderHeaderID:ThisItem.OrderHeaderID})

 

Then in the Item property of your form, you can enter an expression which gets the record you want to display by using First and Filtering on the Context Variable, like this:

First(Filter('[Order].[OrderSummary]', OrderHeaderID = varOrderHeaderID))"

 

But this does not work. In the first part the OrderHeaderID is the column which were used to group the Items. In my case the column I used to group my Items is not accepted and underlined in red.

 

I would be great if someone have an idea, I need to finish the project in the next few days and I dont know how.

 

Best regards 

 

Josef 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Frequent Visitor

Re: Creating Details screen based on subgallery

Hallo @WarrenBelz,

 

The Filterfunction dose not work, because I would lose the structure. 

I solved the problem like this.

1. Creat a Collection base on the nasted Gallery: ClearCollect( "NewCollection"; thisItem) 
2. Creat new Screen with a Gallery ("Gallery1") based on "NewCollection" :  item: "NewCollection"   and for the Labels text:
    thisItem."name".  Screen 2 will never not displayed to the App user
3. Creating my own ViewForm by using TextIputs and Labels, for the TextInputs: Default: "Gallery1".selected."name 

Thank u Warren for supporting me. I realy appreciate that. 

View solution in original post

9 REPLIES 9
Highlighted
Super User III
Super User III

Re: Creating Details screen based on subgallery

Hi @JOBAK1993 ,

All of that should be able to be done.

From your description, you have one SharePoint list with items (you will need to change these to your names)

ItemNameCategory and Size.

You have a sub-gallery which selects the ItemName and Category and presents the different sizes for that item.

I assume the filter for the second Gallery (I have used ListGallery1 and ListGallery2) would be something like

Filter(
   YourSPListName,
   ItemName = ListGallery1.Selected.ItemName
)

The Item property of the view form would simply be 

ListGallery2.Selected

Please tell me if this properly describes your requirements.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Highlighted
Frequent Visitor

Re: Creating Details screen based on subgallery

Hello @WarrenBelz

I use Powerapps since few weeks and I do not realy understand your answer. I am also not sure if my description was good enough. In the appendix I send a Screenshot of my Sharepoint list and of my App.

 

“You have a sub-gallery which selects the ItemName and Category and presents the different sizes for that item.”

 

I have a Main Gallery which groups the Category which is the very same as the ItemName (I know makes no sense, this is just for testing, later on I have to rebuild the data anyway) and the Sub gallery shows the different sizes of the Item.

And the Form should show the details.

Thank your for answeringTESTAPP.pngSharepoint liste.png

Highlighted
Super User III
Super User III

Re: Creating Details screen based on subgallery

Ok @JOBAK1993 ,

You have a nested gallery - this makes it easier as you already have coded this. I was simply trying to establish the structure which I had not seen until now.

I will use these names in blue - you will have to change to your names.

If you want a details form on a new screen, the new Screen is DetailsScreen, the Form DetailsForm and the sub-gallery GallerySub and your List Warenbestand (as per your screenshot)

So on the OnSelect of the GallerySub

Navigate(DetailsScreen)

 Create a new View form (DetailsForm) with the following

DataSource

Warenbestand

If you select this from the menu at the far right of the screen, it will auto-populate the fields

Set the Item to

GallerySub.Selected

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Highlighted
Frequent Visitor

Re: Creating Details screen based on subgallery

Hello @WarrenBelz

this exactly what I tried in the beginning. 
Set the button on Navigate to the details screen. And create a View Form with the same Data source by using the menu right (blue). But it does not auto-populate the fields, not sure what I made wrong. 

Inkeddatasource.jpg

Than I set Item to Gallerysub.selected. 

Item.png

 

So I selected same Field, but they don’t have any values. 

no value.png

I hope you don’t give up hope on me and see my mistake.

Highlighted
Super User III
Super User III

Re: Creating Details screen based on subgallery

OK @JOBAK1993 ,

I am not sure why the auto-populate did not work, but you can easily edit and add fields.

Did you have something selected in the gallery and are the Items of this gallery definitely based on 'Warenbestand Test2'?

Also to prove there is data (you cannot leave this there - it is only  test) put the Items to First('Warenbestand Test2')

 

 

 

Highlighted
Frequent Visitor

Re: Creating Details screen based on subgallery

@WarrenBelz  
when I add fields, it just show me the label and no Data 
If you mean by "Did you have something selected in the gallery"  that I select an Item while the app runs, yes I tried this already. 
Yes the Data based on Warenbestand Test2 and when I put the Items to First('Warenbestand Test2'), data is shown. 

Highlighted
Frequent Visitor

Re: Creating Details screen based on subgallery

@WarrenBelz 

 

Is this corret ? 

Gallery1, Item: GroupBy(Filter('Warenbestand Test2'; TextInput3_11.Text in'Artikel Bez.');"Artikel_x0020_Bez_x002e_"; "Artikel2")

and 
Gallery2, Item: thisItem.Artikel2 


Warenbestand Tast2 = Datasource 
TextInput3_11 = Label with name of the category
Artikel Bez. = column I used for grouping 
Artikel2 = Name of the Groupe in Powerapps 

Would you use another Funktion? 

thanks for helping. 

Highlighted
Super User III
Super User III

Re: Creating Details screen based on subgallery

OK @JOBAK1993 ,

The issue here is that a GroupBy filter in a gallery does not return a single record, but rather a summation of a group of records and this cannot possibly be displayed in a form as it needs to know what single record has to be displayed.

You need a gallery that displays the single records 

Filter(
   'Warenbestand Test2'; TextInput3_11.Text in'Artikel Bez.'
)

and then Gallery1.Selected  will show the item in a form or this could be the filter for Gallery2 and the form selected from this.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Highlighted
Frequent Visitor

Re: Creating Details screen based on subgallery

Hallo @WarrenBelz,

 

The Filterfunction dose not work, because I would lose the structure. 

I solved the problem like this.

1. Creat a Collection base on the nasted Gallery: ClearCollect( "NewCollection"; thisItem) 
2. Creat new Screen with a Gallery ("Gallery1") based on "NewCollection" :  item: "NewCollection"   and for the Labels text:
    thisItem."name".  Screen 2 will never not displayed to the App user
3. Creating my own ViewForm by using TextIputs and Labels, for the TextInputs: Default: "Gallery1".selected."name 

Thank u Warren for supporting me. I realy appreciate that. 

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (6,756)