<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Getting Javascript function to write data to a field in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/getting-javascript-function-to-write-data-to-a/m-p/705890#M190</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ugh.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was just working through the exercises you pointed me to and thought, "oh, i hope it's not because i've referenced the wrong file name" and then i got your email. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks. and sorry to waste your time. but i appreciate you pointing me to the EAP resources.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sean&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 26 Sep 2019 18:13:31 GMT</pubDate>
    <dc:creator>SeanDoig</dc:creator>
    <dc:date>2019-09-26T18:13:31Z</dc:date>
    <item>
      <title>Getting Javascript function to write data to a field</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/getting-javascript-function-to-write-data-to-a/m-p/705886#M186</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to understand how to incorporate a JavaScript function into Survey123. I've read this post: &lt;A class="link-titled" href="https://github.com/tedrick/Survey123-Testing/issues/144" title="https://github.com/tedrick/Survey123-Testing/issues/144"&gt;CHALLENGE: JavaScript functionality · Issue #144 · tedrick/Survey123-Testing · GitHub&lt;/A&gt; and my goal was just to make something really simple. I created the extensions directory inside my survey folder. I created a JS file, MyJSFunctions, with one function:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;function lastName(FullName){&lt;BR /&gt;&amp;nbsp; return FullName;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;One of the fields in my survey is FullName another is LastName. In the xlsForm in the calculation column I added:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;pulldata("@javascript","myJSFunctions.js","lastName",${FullName})&lt;/P&gt;&lt;P&gt;My expectation is (was?) that when I added data into the FullName field that the function would add exactly the same value into the LastName field. I realize this is not the correct way to take data from one field in the survey and replicate it in another field. I'm just making sure I understand the basic functionality before I tackle something more complicated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Once I had that set up, I closed and saved the spreadsheet and published the survey.&lt;/P&gt;&lt;P&gt;When I download the survey to my phone and open it the following text is in the LastName field:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #1d1c1d; font-family: Slack-Lato, appleLogo, sans-serif; font-size: 15px; font-style: normal; font-variant-ligatures: common-ligatures; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #f8f8f8; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;"&gt;Error: Qt.createQmlObject(): failed to create object:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR style="box-sizing: inherit; color: #1d1c1d; font-family: Slack-Lato, appleLogo, sans-serif; font-size: 15px; font-style: normal; font-variant-ligatures: common-ligatures; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #f8f8f8; text-decoration-style: initial; text-decoration-color: initial;" /&gt;&lt;SPAN style="color: #1d1c1d; font-family: Slack-Lato, appleLogo, sans-serif; font-size: 15px; font-style: normal; font-variant-ligatures: common-ligatures; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #f8f8f8; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #1d1c1d; font-family: Slack-Lato, appleLogo, sans-serif; font-size: 15px; font-style: normal; font-variant-ligatures: common-ligatures; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #f8f8f8; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #1d1c1d; font-family: Slack-Lato, appleLogo, sans-serif; font-size: 15px; font-style: normal; font-variant-ligatures: common-ligatures; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #f8f8f8; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #1d1c1d; font-family: Slack-Lato, appleLogo, sans-serif; font-size: 15px; font-style: normal; font-variant-ligatures: common-ligatures; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #f8f8f8; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;"&gt;qrc:/var/mobile/Containers/Data/Application/E1C84E25-205E-4EB7-BCB1-983CFB06576F/Documents/ArcGIS/My Surveys/c0e1879901d442cc8b4bbbddc96c1716/esriinfo/extensions&lt;/SPAN&gt;&lt;SPAN style="color: #1d1c1d; font-family: Slack-Lato, appleLogo, sans-serif; font-size: 15px; font-style: normal; font-variant-ligatures: common-ligatures; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #f8f8f8; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;"&gt;:2:&lt;/SPAN&gt;&lt;SPAN style="color: #1d1c1d; font-family: Slack-Lato, appleLogo, sans-serif; font-size: 15px; font-style: normal; font-variant-ligatures: common-ligatures; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #f8f8f8; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;"&gt;1: Script file:///var/mobile/Con&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What am I doing wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sean&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Sep 2019 16:45:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/getting-javascript-function-to-write-data-to-a/m-p/705886#M186</guid>
      <dc:creator>SeanDoig</dc:creator>
      <dc:date>2019-09-26T16:45:24Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Javascript function to write data to a field</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/getting-javascript-function-to-write-data-to-a/m-p/705887#M187</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; you can find detailed&amp;nbsp; instructions about using custom JS functions in our &lt;A href="https://www.esri.com/en-us/early-adopter"&gt;Early Adopter Program&lt;/A&gt;. First login into the Survey123 Early Adopter Program, and then look in the Documentation section for the JS article (is at the&amp;nbsp; bottom of the list). Here is a direct link (&lt;A _jive_internal="true" href="https://community.esri.com/thread/article/item.html?cap=e69ef91f45744b98882c651f7b518eb7&amp;amp;arttypeid={5a8e51ed-4a87-43fe-a67d-2b7829af130f}&amp;amp;artid={D2F0ED6D-1ADC-43EF-8A87-FCCF09381DB3}"&gt;you will need to be logged-in into the EAC website&lt;/A&gt;).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; To diagnose the&amp;nbsp; issue you are having, it would be easier if you share the entire survey folder you are building.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ismael&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Sep 2019 17:03:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/getting-javascript-function-to-write-data-to-a/m-p/705887#M187</guid>
      <dc:creator>IsmaelChivite</dc:creator>
      <dc:date>2019-09-26T17:03:25Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Javascript function to write data to a field</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/getting-javascript-function-to-write-data-to-a/m-p/705888#M188</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the quick response. I'm attaching the zipped survey folder. I'll join the early adopter program. Thanks for any additional feedback you can give me. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sean&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Sep 2019 17:10:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/getting-javascript-function-to-write-data-to-a/m-p/705888#M188</guid>
      <dc:creator>SeanDoig</dc:creator>
      <dc:date>2019-09-26T17:10:19Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Javascript function to write data to a field</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/getting-javascript-function-to-write-data-to-a/m-p/705889#M189</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The issue is that your file is called &lt;EM&gt;MyJSFunctions.js&lt;/EM&gt; but in XLSForm you are referencing &lt;EM&gt;myJSFunctions.js&lt;/EM&gt;.&amp;nbsp; If&amp;nbsp; you change the expression in the calculation to&amp;nbsp; &lt;EM&gt;pulldata("@javascript","MyJSFunctions.js","lastName",${FullName})&lt;/EM&gt;&amp;nbsp; is will work well. M != m &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/wink.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;JS Functions are still not ready for prime time, hence why we have not officially documented this outside of the Early Adopter Program.&amp;nbsp; Please use Early Adopter Program to report feedback on this particular feature (to avoid confusion). Thanks a lot!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just some things you should be aware: 1) Every time you change your JS file, you need to re-open Connect.&amp;nbsp; 2) JS Functions only work in the field app. 3) JS functions do not run if you sign out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="460518" alt="" class="jive-emoji image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/460518_Untitled.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Sep 2019 17:56:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/getting-javascript-function-to-write-data-to-a/m-p/705889#M189</guid>
      <dc:creator>IsmaelChivite</dc:creator>
      <dc:date>2019-09-26T17:56:49Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Javascript function to write data to a field</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/getting-javascript-function-to-write-data-to-a/m-p/705890#M190</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ugh.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was just working through the exercises you pointed me to and thought, "oh, i hope it's not because i've referenced the wrong file name" and then i got your email. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks. and sorry to waste your time. but i appreciate you pointing me to the EAP resources.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sean&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Sep 2019 18:13:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/getting-javascript-function-to-write-data-to-a/m-p/705890#M190</guid>
      <dc:creator>SeanDoig</dc:creator>
      <dc:date>2019-09-26T18:13:31Z</dc:date>
    </item>
  </channel>
</rss>

