4

What is the proper syntax for calling fields outside the current section for the calculation fields?

4
  • I am a developer for Cognito Forms. Currently no syntax is available to call to a field outside of a section. Where are the fields located in relation to one another? – Nicholas Gasque Sep 15 '14 at 12:25
  • To add to the comment by @NicholasGasque, you can reference fields in child sections using syntax like ChildSection.Field, but cannot access fields in parent sections (and therefore not sibling sections). What syntax do you think would make sense for this? We have been considering adding a Parent property to represent the parent section, but have held off because we were concerned it would be too confusing for most users. In this case accessing a field in a sibling section would look like Parent.SiblingSection.Field. – Jamie Thomas Sep 15 '14 at 17:19
  • I was simply using sections (perhaps incorrectly) to group fields visually. And, I was wanting to have some calculation fields in a summary section that referenced fields in different (sibling or parent) sections. Since the sections were only being used for visual grouping, I just removed them and put all of the fields together. – Deaconweb Sep 16 '14 at 13:21
  • As long as your summary fields are not in a section, you can still have your other fields in sections for visual grouping, as calculations can reference fields in "child" sections, just not "siblings". Glad you were able to figure out a workaround for your case! – Jamie Thomas Sep 17 '14 at 16:29
1

You can now write calculations within sections in Cognito Forms that reference other sections or the parent form.

Simply type Form. within calculations to access fields and sections at the form level while writing calculations inside a section. Also, when writing calculations inside a section which is inside a repeating section, you can use ParentSection. to access the parent repeating section item.

Please check out our help documentation for more information: https://www.cognitoforms.com/support/2/calculations

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.