0

I am using a simple Pizza order form, which contains some basic details and a toppings section - Toppings. It is a repeating section which contains a drop box to select the topping.

Now, each time a topping is added, I want a text field ToppingTotal to be updated with the number of toppings.

Here's what I did:

  • Added a Rule on Toppings which runs whenever section is changed
  • Set the action to set the value of ToppingTotal to count(.)

The rule does run each time a topping is added, but the value of ToppingTotal is set each time to 1.

Can someone point in the right direction? Thanks.

  • Where you have added "set the action to set the value of ToppingTotal to count(.)" rule? – Viraj Gorajia Apr 13 '16 at 9:01
  • is it by any chance related to SharePoint ? You can post this in web forum instead – Gaurravs Apr 13 '16 at 9:01
  • @Viraj On the Toppings section itself. – aditya_m Apr 13 '16 at 9:01
0

Add function

count(select Toppings from repeating section)

to value textbox from ToppingTotal property.

  • It worked! Can you explain why it worked on the ToppingTotal field and not the actual repeating section itself? – aditya_m Apr 13 '16 at 9:11
  • In repeating section, there are multiple Toppings. You have added this rule to each topping. So one Topping will return 1 count in ToppingTotal textbox. And other toppings overwrite count in ToppingTotal textbox. – Viraj Gorajia Apr 13 '16 at 9:15
  • Okay. It now works when I add toppings. But when I remove, it should decrease the count, which is not happening. Any clues? – aditya_m Apr 13 '16 at 9:20
  • Are you able to add rule to sub repeating group? or try to set postback always from property of ToppingTotal textbox. – Viraj Gorajia Apr 13 '16 at 9:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.