Tap Forms Database Pro for Mac, iPhone, iPad and Apple Watch › Forums › Using Tap Forms 5 › Bug report: Brackets in text fields lead to errors in calculations
Tagged: bug
- This topic has 6 replies, 2 voices, and was last updated 5 years, 10 months ago by
Brendan.
-
AuthorPosts
-
December 24, 2019 at 12:03 AM #38880
Chris JuParticipantHello Brendan,
is there a way to prevent that?
To reproduce that bug, you can put a text with brackets > “(” or “)” < in the text/note field and try to calculate with that field, e.g.
IFNOTEMPTY (;”1″;”0″)
Thanks
ChrisDecember 25, 2019 at 1:40 AM #38899
BrendanKeymasterHi Chris,
I’ll have to look into this issue.
In the meantime, a Script Field would do the job without this issue.
Can you please email me your form template and I’ll test with what you have?
Thanks,
Brndan
December 26, 2019 at 12:10 AM #38910December 26, 2019 at 12:32 AM #38914
BrendanKeymasterHi Chris,
Thanks for the template.
Do you mean if I enter square brackets into the contents of one of your Note fields then it doesn’t work?
Because it worked for me just fine. Although you are returning text instead of Numbers as you have your 1 and 0 surrounded with double-quotes. Since you have Tap Forms set to return a Number, you should return 0 and 1 instead of “0” and “1”.
See attachment.
Attachments:
You must be logged in to view attached files.December 26, 2019 at 12:34 AM #38916
BrendanKeymasterOh, and instead of using the SUM() function, you can just add the values together like this:
IFNOTEMPTY(S1; 1; 0) + IFNOTEMPTY(S2; 1; 0) + IFNOTEMPTY(S3; 1; 0) + IFNOTEMPTY(S4; 1; 0)
December 26, 2019 at 12:40 AM #38917
Chris JuParticipantNo, it only leads to an error, if round bracket are used and if it’s not closed (see attachments)…
Attachments:
You must be logged in to view attached files.December 26, 2019 at 2:56 AM #38926
BrendanKeymasterOh I see. Sorry, I missed that it had to be just a single bracket.
You’re right. It’s getting a parse error.
invalid formula - unable to parse: Missing bracket ")" in expression <SUM(IFNOTEMPTY("One (";"1";"0");IFNOTEMPTY("[Two]";"1";"0");IFNOTEMPTY("Three";"1";"0");IFNOTEMPTY("Four";"1";"0"))>.I’ve been working on this issue this evening and I finally fixed it. You’ll be able to put any number of parentheses within your text now and Tap Forms will be able to properly parse the formula. It wasn’t checking for quotes properly before checking to see if the parentheses are balanced in the formula.
-
AuthorPosts
You must be logged in to reply to this topic.