Select to view content in your preferred language

Survey123 form now shows "Scripts disabled" for value calculated using Javascript function

3905
11
Jump to solution
11-04-2020 12:59 PM
ABorowik
Emerging Contributor

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.

0 Kudos
1 Solution

Accepted Solutions
by Anonymous User
Not applicable

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.

View solution in original post

0 Kudos
11 Replies
by Anonymous User
Not applicable

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.

0 Kudos
ABorowik
Emerging Contributor

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

0 Kudos
by Anonymous User
Not applicable

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.

The survey needs to be in the Hub org for Hub users to be able to run JS functions.
Regards,
Phil.
0 Kudos
EvanR
by
Occasional Contributor

@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.

0 Kudos
by Anonymous User
Not applicable

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.

0 Kudos
EvanR
by
Occasional Contributor

@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."

0 Kudos
GGI_01
by
New Contributor

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

0 Kudos
by Anonymous User
Not applicable

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.

0 Kudos
BillSimper
Regular Contributor

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.

0 Kudos