Tap Forms Database Pro for Mac, iPhone, iPad and Apple Watch › Forums › Using Tap Forms 5 › Calculation Field Creation Crash
- This topic has 4 replies, 3 voices, and was last updated 5 years, 6 months ago by
Chris Medeiros.
-
AuthorPosts
-
April 20, 2020 at 9:49 PM #40358
Chris MedeirosParticipantI could use some help trying to create a calculation field.
BACKGROUND: I have two fields. Field one, “Ounces Available”. Field two, “Footage Available”. Either one field or the other will have a value greater than 0, but not both simultaneously.
GOAL: To have one field show a NULL if the other has a value greater than 0.
RESULT: I’m able to create the calculation for one field, “Footage Available”. (Please see attachment, “Screen Shot 1”). However, after creating the calculation formula for the second field, “Ounces Available”, when I click on Save, Tap Forms leaves the room.
Could it be because I’m creating some sort of circular reference?
Attachment 1: Screen shot of first, successful calculation formula.
Attachment 2: Screen shot of second, unsuccessful calculation formula, right before clicking Save and Tap Forms blipping off the display.NOTE: I can duplicate this issue consistently.
Attachments:
You must be logged in to view attached files.April 21, 2020 at 1:16 PM #40364
BrendanKeymasterYa, you don’t want to create a circular reference. A -> B -> C -> A, and so on.
That’ll cause an infinite loop because Tap Forms tries to evaluate the results of the formula by resolving any sub-formulas first. If those sub-formulas reference themselves or referent the parent formula, then you’ll get stuck.
April 21, 2020 at 3:42 PM #40365
Chris MedeirosParticipantAh, okay. I’ll have to figure out another way to achieve my goal. Thanks!
April 22, 2020 at 10:55 PM #40367
Sam MoffattParticipantTo potentially work around this, you could use a script field instead and have the script field update the value of the other fields correctly. That way you only have one thing executing (your script field) and it’ll update the fields correctly. You’ll then have to convert the calc fields into normal number fields to finish everything up.
April 25, 2020 at 8:51 PM #40373
Chris MedeirosParticipantThanks Sam. That’s a good solution. I ended up finding a different field to evaluate the result I was looking for.
-
AuthorPosts
You must be logged in to reply to this topic.