Survey123 - Execute calculation (JS function) only ONCE

298
1
Jump to solution
11-08-2023 04:04 PM
EM-wsp
by
New Contributor III

Hi,

I have a JS function which makes a POST request to the hosted service. I use it in the Survey123 form to create new data entries in the feature class on the side. I really need to take the execution of this function under control. I tried different variations of calculation modes (manual, whenEmpty), "if" statements, "relevant". Nothing gives a confidence that the function is executed only once. In reality, while filling/testing the survey it appeared to be executed 4-5 times.

I am wondering if there is a robust way to restrict the calculation to only one time. "whenEmpty" doesn't appear to work reliably here.

Tags (3)
1 Solution

Accepted Solutions
EM-wsp
by
New Contributor III

I found that using once() in formula makes a trick.

View solution in original post

0 Kudos
1 Reply
EM-wsp
by
New Contributor III

I found that using once() in formula makes a trick.

0 Kudos