Could you maybe help me with a problem I have while publishing a survey in Arena: I have a working and error free survey in Collect and Collect Mobile and want to try this in Arena. Import works fine, but when I try to publish I get errors for two calculated fields (Default value not specified). In these two variables I just calculate a corrected distance depending on a measured slope angle. The expression is correct and it works in Collect Mobile, but Arena does not recognize the default value.

Thank you very much! Lutz

asked 07 Feb, 11:27

Fehrmann's gravatar image

Fehrmann
7731632
accept rate: 0%


Dear Lutz,
The expression you have to specify as default value shoule be something like this:

Math.sqrt(200) / Math.cos(slope_angle * Math.PI / 180)

Be careful that Math.cos gets the angle in radians, so it must be converted first, with an expression like angle * Math.PI / 180

Let us know if it works in your case, many thanks.
Open Foris Team

permanent link

answered 07 Feb, 15:04

Stefano%20%28OF%29's gravatar image

Stefano (OF) ♦♦
4.7k19
accept rate: 20%

Dear Lutz,
When you import a survey from Collect, Arena converts automatically the expressions for default values or validation rules from XPath (used by Collect) to JavaScript (used by Arena) and if there is any errors translating the expressions , a Collect Import Report will be generated.
You can access this report from the Arena survey home page:
alt text

The report is explained in details in the Arena user manual (you can dowload it from our website, in the page under Tools / Arena, in the chapter 6.5 Collect import report).

In that report you have the possibility to see what was the expression in Collect that could not be translated automatically. What is the expression in your case?
Please let us know if you need support from our side.
Many thanks,
Open Foris Team

permanent link

answered 07 Feb, 14:15

Stefano%20%28OF%29's gravatar image

Stefano (OF) ♦♦
4.7k19
accept rate: 20%

edited 07 Feb, 14:16

Thanks for fast reply! I found my workaround solution by deleting the two critical variables for the moment, but it would be nice to understand the problem (with reduced priority).

I checked this import log before, but it does not help to find the error. I just see that two variables could not be resolved.

My expression is simple: math:sqrt(200) div math:cos(slope_angle)

It is just a calculated field that shows a corrected distance dependent on slope angle and works fine in Collect + Mobile. I tried to set a default for slope angle (hoping that this is the problem), but it doesn't help.

Checking the user manual (page 15 first figure), I see the same message in your example (Default value not specified). In a calculated field the default is given by the expression and either my expression cannot be translated to Java Skript or expressions in calculated fields are not read as a default value.

permanent link

answered 07 Feb, 14:42

Fehrmann's gravatar image

Fehrmann
7731632
accept rate: 0%

edited 07 Feb, 14:48

The problem was the XPath syntax for division (div) that was not recognized. Manually entering Math.sqrt(200)/Math.cos(slope_angle) in the advanced editor solved the problem! Thank you!

permanent link

answered 07 Feb, 15:04

Fehrmann's gravatar image

Fehrmann
7731632
accept rate: 0%

Thank you, just found the point! Like always: very efficient 5 star support!

permanent link

answered 07 Feb, 15:07

Fehrmann's gravatar image

Fehrmann
7731632
accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×42

question asked: 07 Feb, 11:27

question was seen: 586 times

last updated: 07 Feb, 15:07