I have the following code :
LookUp(Ideas, New_Idea_Gallery.Selected.IdeaID = IdeaID),
'Impact and Gain': Impact_Input_1.Text,
'Time required': Value(Estimated_Hours_Input_1.Text),
'Is this related to a product ?': 'Product_relate_?_input_1'.Selected.Value,
'Status of the Idea': 'Status of the Idea'.Submited}
cbproduct_3.SelectedItems As cbprodselected,
LookUp(Junction_Table_Idea_Products, New_Idea_Gallery.Selected.IdeaID = Idea_L.IdeaID),
Idea_L : First(Mypatchedrecords)
When I change cbproduct_3.selecteditems to gallery3_1.allitems.
I have an error stating :
Any idea ?
Solved! Go to Solution.
The complicated part is because it is a N:N in form of a junction table.
We have Idea 1:N to Junction Table and N:1 to Product
The primary key of Idea table is : IdeaID
The primary key of product table is : ProductID
The primary key of the junction table is : Idea_Product_ID
Whenever I need to interrogate the product or Idea table, I am missing one of the other ID which is found via a lookup and somehow I just can't get the schema correct and yes I was hoping you said there was easier ways... because it is a nightmare right now
That is all just fine. The point is to make sure you are pulling in the primary keys to your galleries.
When you are patching the junction table, you will be doing the patch formula I provided and supplying the Idea_Product_ID column to the statement.
Same for the others, you will need to provide the IdeaID for Idea table and ProductID for Product Table. These ID should be brought in directly and used for the purpose of the patching.
This makes it all quite easy.
I am not familiar enough with your specific design to know which gallery is which and what you are trying to do in each. But, for the most part, as I see it, you need two galleries - one for product and one for Ideas. After that I am not sure exactly what you are doing.
But, the beauty of the Patch statement (in regard to the junction table) is if you add new items, then the primary key (Idea_Product_ID) will be blank. So when you issue the formula I provided, it will update any existing records and create new ones for the blank ones.
However...centering the above around collections is a challenge because the collections will not change when you do that. You constantly need to maintain the collection. If you just set the Items based on the actual table and filter based on the other gallery, then it will all be automatic.'
Allright lets go step by step then.
I've removed all collection.
I only have 2 gallery.
1: Showign all the product associated with the Idea ( galprodselected)
2: I need a gallery showing all the product except those already in gallery 1. ( galprodavailable )
I did it using a collection before but now I'm thinking...
1st gallery items :
Idea_L.IdeaID = New_Idea_Gallery.Selected.IdeaID
and the element in the glalery is : ThisItem.Product_L.Name
The second one I need something like...
Filter(Products,Not(ProductID in Galprodselected.AllItems)) but it ain'T working.
Well before going too far, what is it that you are trying to accomplish? I am only guessing from the picture in Message #9. But I'd rather not guess it through and take you down the wrong road.
So, what is the purpose of the app, or at least this screen?
The project is to have an application where employees could submit their idea whatever the type of idea it is and then other employees can vote on the idea they like the most
I have a page with new idea creation
On this page, it is an idea that you created but you saved it for later sort of acting like an edit form. the status of this idea in this case is at saved where as another idea with status submitted, you wouldn't be able to edit it, so lets say you created your idea you did not attach a product to it, you would return to this screen and add them
Thanks for the description!
I am a little confused then why the choice of a many to many relationship is needed. Is the Idea submitted to be related to multiple products and that the product would have multiple ideas?
Just trying to get a better handle on your needs.
Mate, I can't thank you enough. I've been chatting here for a long time and with other post and I wasn't able to sort it out. I spent literally 40hours on this problem
You went above the expectation with a real time meeting, spent 3h with me to find out that a microsoft feature doesn't allow me to filter properly. I'll let you post the solution here. ( Service quality 20 on 10 ! )
Good job mate !
I am so glad I was able to help with all of the issues and thanks so much for your kind words it really does mean a lot 🙂 !
The root cause of this issue links back to this setting once turned off an refreshed the issue was resolved:
Once this was resolved the Items property of the Gallery functioned as expected and the schema issues were gone.
Thanks again for your kind words and good luck on your Power App Journey!!! 😄
If you appreciated my comments/responses please be sure to Like/Kudo them it really does make me smile 🙂 !
I'm assuming since you mention @AJ_Z and about a one-on-one conversation off of the forum, that you have arrived at a solution.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
At the monthly call, connect with other leaders and find out how community makes your experience even better.