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

Calculating SUM of datacards prior to submitting to Sharepoint

I have 7 fields that must sum to a specific amount prior to submittal to SharePoint list. I have SP list handling the validation as well as returning them to the selection screen to adjust responses but was wondering if there was a way to calculate these columns and display on the Powerapp form as these amounts are selected from the dropdowns. I do have a total amount field in sharepoint but of course it doesnt sum until submitted. 

 

I was then wanting to not allow the "Submit" button be displayed unless the specified amount was achieved. Any ideas? I can not find anything on the subject.

 

Capture.JPG

1 ACCEPTED SOLUTION

Accepted Solutions
tchin-nin
Level 10

Re: Calculating SUM of datacards prior to submitting to Sharepoint

Sorry my bad, you'll have to use
DataCard Skye.Selected.Value

Théo
4 REPLIES 4
tchin-nin
Level 10

Re: Calculating SUM of datacards prior to submitting to Sharepoint

Hi @tonyarc,

So you have 7 fields containing an amount and you want the Submit button to be enabled only if the sum of the 7 fields is greater than a specified amount, is that right ? 

 

Your Amount input look like dropdownlist so I assume 7 dropdown named : Amount1, Amount2, ... Amount7. And I will fixe the specific amount to 1000 to enable the Submit button.

 

SubmitButton.DisplayMode :
if(Sum(Value(Amount1.value), Value(Amount2.value), Value(Amount3.value), Value(Amount4.value), Value(Amount5.value), Value(Amount6.value), Value(Amount7.value)) > 1000, DisplayMode.Edit, DisplayMode.Disabled)

Théo

tonyarc
Level: Powered On

Re: Calculating SUM of datacards prior to submitting to Sharepoint

Thanks Theo Here is what I have done: I set Display Mode of my Submit button to If(Sum(Value(DataCardValue38.value), Value(DataCardValue39.value), Value(DataCardValue40.value), Value(DataCardValue41.value), Value(DataCardValue42.value), Value(DataCardValue44.value), Value(DataCardValue1.value)) = 2000,DisplayMode.Edit,Disabled) Im getting "the function Value has some invalid arguments"
tchin-nin
Level 10

Re: Calculating SUM of datacards prior to submitting to Sharepoint

Sorry my bad, you'll have to use
DataCard Skye.Selected.Value

Théo
tonyarc
Level: Powered On

Re: Calculating SUM of datacards prior to submitting to Sharepoint

worked perfectly - thanks Theo!!