cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
hnguy71
Level 8

Passing Child Gallery Sum to Parent Gallery

Hi All.
I have two galleries, 1 Parent (Upper) and 1 Child (Lower). I have created a Label Control and inside the Default Property I'm able to add the sum of the reconciled amount from the Child gallery. 

sum_works.png
Now, I'm trying to pass that information back to my previous Parent gallery using a Button control and on it's OnSelect Property I have this:

Navigate(r_SummaryScreen, ScreenTransition.None, {d_Reconciled: txt_Detail_Sum.Text})


However, when I'm in the Parent gallery, I have a singular record that I want to update to reflect the amount correctly. Is that possible?

So I have this. I want that 600 from here:
current_output.png

to come to the Parent gallery into here:
desired_output.png

Thanks for any help!

EDIT: I dont want the value to pass to all the fields like this:
not_like_this.png

1 ACCEPTED SOLUTION

Accepted Solutions
hnguy71
Level 8

Re: Passing Child Gallery Sum to Parent Gallery

Hi @v-yutliu-msft also gonna implore some help from @RandyHayes ,

 

My parent gallery has this formula inside the Items property:
parent_Items.png

Inside my gallery there's a + button and on it's OnSelect property I have this:
onselect.png

And finally, the patch the parent record I have this:
patch_navigate.png

I think the patch formula should work but I get this error:
error.png

Any ideas?

EDIT: I've added a column in SharePoint to add a column for the email as a temporary workaround and seems like it's starting to form nicely but I'm encountering a different issue:

record_not_found.png
I debugged using a text label and adding this to the text property:

_ParentItem.ID

And I was successfully able to find the matching record to update but the Patch function tells me otherwise.

EDIT2: Came back from lunch and it works.... weird.

View solution in original post

5 REPLIES 5
Community Support Team
Community Support Team

Re: Passing Child Gallery Sum to Parent Gallery

Hi @hnguy71 ,

Do you want to display a vriable only in one item of the gallery?

I've made a similar test and found that:

Inset a label and move it to the position of Reconclied

Set the label's Text: 

txt_Detail_Sum.Text

 Then , only this postion will show the sum result.

531_LI.jpg

If you choose the pen icon on the gallery, then every item will display the sum result. So do not choose that before inset the label.5312_LI.jpg

 

 

Best regards,

Community Support Team _ Phoebe Liu

 

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
hnguy71
Level 8

Re: Passing Child Gallery Sum to Parent Gallery

Hi @v-yutliu-msft ,

thanks for the reply!

 

Visually it's close to what I want but as I'm sitting here thinking about it, I think a singular record patch might do the trick. So what is needed is when OnSelect from the Child gallery that it find the matching item from the parent and patches the item in the collection.

I'll have to experiment with it tomorrow. Hopefully that's the right idea. hahaha

Community Support Team
Community Support Team

Re: Passing Child Gallery Sum to Parent Gallery

Hi @hnguy71 ,

Yes, insert a Reconciled field in the data source of Parent Gallery is a good way.

Then, display Reconciled field in Parent Gallery.

Set the Child Gallery's Button's OnSelect:

Patch(table,Parent Gallery.Selected,{Reconciled:txt_Detail_Sum.Text})
Navigate(r_SummaryScreen, ScreenTransition.None, {d_Reconciled: txt_Detail_Sum.Text});

 

Best regards,

Community Support Team _ Phoebe Liu

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
hnguy71
Level 8

Re: Passing Child Gallery Sum to Parent Gallery

Hi @v-yutliu-msft also gonna implore some help from @RandyHayes ,

 

My parent gallery has this formula inside the Items property:
parent_Items.png

Inside my gallery there's a + button and on it's OnSelect property I have this:
onselect.png

And finally, the patch the parent record I have this:
patch_navigate.png

I think the patch formula should work but I get this error:
error.png

Any ideas?

EDIT: I've added a column in SharePoint to add a column for the email as a temporary workaround and seems like it's starting to form nicely but I'm encountering a different issue:

record_not_found.png
I debugged using a text label and adding this to the text property:

_ParentItem.ID

And I was successfully able to find the matching record to update but the Patch function tells me otherwise.

EDIT2: Came back from lunch and it works.... weird.

View solution in original post

Highlighted
Super User
Super User

Re: Passing Child Gallery Sum to Parent Gallery

@hnguy71 

Your primary problem with that was you are adding a column to the parent gallery Items "findReviewer".  Then you are setting a variable to the selected gallery item.  That's all fine except that the record you now have in the variable has a different signature than the datasource and cannot be used directly without dropping that added column.

Here is what I use to do that (using your formula):

   Set(_ParentItem, First(DropColumns(Table(g_Summary.Selected), "findReviewer")))

After that, your _ParentItem will now match the signature for the datasource and your Patch will work properly.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,791)