cancel
Showing results for 
Search instead for 
Did you mean: 

ParentItem in nested gallery

Please create an object like ParentItem as a reference to the current item in parent gallery, in the same way like ThisItem is reference to current item in gallery, it will be very useful during filtering items for nested galery. 

 

Regards, 

MarcelLee

Status: New
Comments
Meneghino
Community Champion

Hi @MarcelLee

I think what you request can be easily done with current functionality.

For filtering you just use ThisItem in the Items property of the nested gallery.

If you need the parent value in the nested gallery template, then you add a column with the parent gallery primary key (e.g. ID) value.

Please let me know if this is not clear or clarify your requirement if you think it cannot be met.

MarcelLee
Advocate IV

Hi @Meneghino

 

I tried this before, it did not work for some reason. Now I've tried it again, and your solution works perfectly. Thank you!

 

 

Regards,

MarcelLee

Jerry1567
Advocate II

There are many situations where this may be very useful.
In a nested gallery, the child may need access to the parent's columns to do a specific filter to get some additional information to display.

 

I don't see any workarounds to this unless you want the child's items to be purely a Filter based on ThisItem of the parent which only works on the Gallery level but not individual child item level in the gallery.

 

In the current scenario that I am working on, The parent gallery is connected to a Tasks table and the child gallery are a table showing all employees available in a project. A label inside this child gallery may be cost, which may need look something like this. Filter(Cost, employee=employID (from child) && task=taskID (fromParent) and this may not be achieveable.

MichaelNguyen
Frequent Visitor

@Meneghino

Can you elaborate on this add a column with the parent gallery primary key (e.g. ID) value. I need to access each item of the parent gallery( items in parent gallery are in an array)

zuleika_v
New Member

I have a scenario where I need to access the parent item, but my nested gallery isn't directly related to the parent gallery.

 

Example:

I'm doing a commissions table where my commissions table is linked to my quote table. My quote table is linked to my quote products.

Gallery 1 adds users to the commissions table and works out the percentage they earn for the sale.

Gallery 2 shows the quote products, nested gallery shows the commissions table nested and a breakdown of exact commissions per line.

 

To make this work, I would need to get from the parent gallery to actual values of the items, then calculate the commissions on that item. It would be super helpful to be able to reference the parent item directly, because there's not really any unique link between the parent and nested gallery (they are linked by quote ID, but all products will have the same quote ID).

 

Yes I could make the commissions table link to the quote products, but the percentage is worked out at the quote level, so it just makes it messy, also means 1 row per quote product multiplied by the number of people who need to be paid commissions.