cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Helper III
Helper III

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

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
Highlighted
Helper III
Helper III

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

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
Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,427)