1

Let's say I have a form with two sections: "About You" and "About your Spouse". In each section, there is a PhoneNumber field. I would like for the default value of the "About your Spouse" PhoneNumber fields to be the value from the "About You" PhoneNumber field. However, when I type an "=" in the Default Value box of the "About Your Spouse" PhoneNumber field, I can't figure out how to reference the other field from a different section of the form.

If the field is in the same section, there is no problem.

I tried typing in =AboutYou.PhoneNumber but that didn't work.

I've also tried =Form.AboutYou.PhoneNumber and =Entry.AboutYou.PhoneNumber. I didn't expect those to work based on the structure of the JSON string that is generated when the form is submitted, but a desperate person will try many things. ;-)

There are other areas within Cognito forms where I need to reference a field from a prior section and cannot figure it out. Hopefully the same answer that pertains to this question pertains there as well.

2 Answers 2

1

Tom, unfortunately you cannot reference fields from "sibling" or "parent" sections in Cognito Forms right now. We are working on enabling this, but it is a bit more complicated than it would seem at face value, factoring in our support for validation, intellisense, automatic renaming, repeating setions, etc. that is built into our calculation system. Plus, this introduces what is called a "circular reference" in the model for the form, which presents it's own unique issues (like the browser or server crashing if we get it wrong).

This is on our Idea Board under In Progress, because we are actively working on adding support for these types of calculations: https://trello.com/c/dKhdGujx. Please up vote this feature and feel free to add a comment explaining how you plan to use this capability.

0

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#cross-section-calculations

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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