cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JasonF
Level: Powered On

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
Level: Powered On

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
JasonF
Level: Powered On

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
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (8,858)