We have developed a survey that uses pulldata(@javascript..) to invoke a javascript function to calculate a value. The survey with the js function has worked in the past but it suddenly presenting the user with "Scripts disabled" where the calculated value should be.
My Survey123 app was recently upgraded to version 3.11 but the error still appears in S123 v 3.10.x on another device. The error also appears using both iPad and Android, so doesn't seem to be related to the OS.
The survey is shared to an ArcGIS Hub group within AGO org. The error does NOT appear when I use my AGO account rather than an account from the Hub. I am aware that JavaScript functions are only supported in forms completed by users in the same organization as the form author, but the Hub group is part of the AGO org and has worked previously.
Solved! Go to Solution.
Hi @GGI_01,
There is no workaround and this is the expected behaviour. For security reasons JS functions can not be executed in organizations that are different to the organization that the JS function originated from. There is no plan to change this in the future.
Regards,
Phil.
Hi Ann,
JavaScript functions are only supported for signed in users and for users from the same org that the survey originates from. Are the users you have shared the survey to in the ArcGIS Hub group in the same org?
Regards,
Phil.
Hi Phil,
The survey is not shared publicly, the users are signed in. The users are signed in using a Hub account that is part of the main organization, the same one that the survey originates from.
Thanks,
Ann
Hi Ann,
It sounds like a cross org issue, the Hub org and the org you have published the survey in are actually different, but linked.
@Anonymous User, I am having the same issue. Publishing to the NPS org from Survey123 Connect, not shared with anyone, downloading on an Android tablet that is signed into my NPS org account, and I still get the "scripts disabled" message.
Hi @EvanR,
Is the NPS org a Hub org? Is it the same original org as your username?
For JavaScript functions to be enabled and allowed, you must be signed in and the username must originate from the same org that the survey was published, not a shared org where the username and items are actaully in different org ids.
Regards,
Phil.
@Anonymous User: from the regional NPS GIS support staff:
"As far as I am aware we only use ArcGIS Hub in very specific instances, mostly for open-data. Though I may be wrong about that.
I would let Phil how that you are not using a Hub site at all, and are sharing the survey with the organization the survey originates from."
Hi, is there any update to this? Can 1 organization share a Survey form to a second organization and use JS functions? If not is there a planned data to allow this? This situation dramatically reduces the value of Survey 123. Is there a work around?
Jeff
Hi @GGI_01,
There is no workaround and this is the expected behaviour. For security reasons JS functions can not be executed in organizations that are different to the organization that the JS function originated from. There is no plan to change this in the future.
Regards,
Phil.
Hi Phillip,
I'm having this problem ('Javascript functions are disabled'). My form is published in our Hub org and I'm signed into Survey123 with a Hub account (actually tried with several Hub accounts). This had been working previously, it's been a few months since I've looked at this form.