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

Sum a Gallery in Powers to set the Default value in a form

Not sure what I am doing wrong here and the error not making sense. I have a Detail Form and Gallery of records related to it by setting the Items of the Gallery to the form. So I was thinking it would be easy to set the value of field (on the form) from the gallery. Specifically sum the total of the gallery and update the "Total Sales" field of the form. My intent was to set the default value of the field to 'Sum(Gallery3.AllItems,Amount)". Make sense right?? But NO. For some reason I am getting a "Rule creates a circular reference between properties"... How? ... Why?

 

Anyway, any help would be appreciated or a workaround would be great.

Here is a screen shot for reference:

Sum1.JPG

1 ACCEPTED SOLUTION

Accepted Solutions
JasonF
Helper III
Helper III

I answered my own question. Although I still not understand the circular reference a workaround can be achieved by Setting a variable and assigning that variable to the default.

On posting a detail record:

SubmitForm(Form4); Set(TotalSales,Sum(Gallery3.AllItems,Amount))

And setting the default on the Form for 'Sales Total' :

TotalSales

View solution in original post

1 REPLY 1
JasonF
Helper III
Helper III

I answered my own question. Although I still not understand the circular reference a workaround can be achieved by Setting a variable and assigning that variable to the default.

On posting a detail record:

SubmitForm(Form4); Set(TotalSales,Sum(Gallery3.AllItems,Amount))

And setting the default on the Form for 'Sales Total' :

TotalSales

View solution in original post

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (2,043)