<?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: Custom JS function behaving differently in webapp vs in Survey123 Connect in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/custom-js-function-behaving-differently-in-webapp/m-p/1621846#M62916</link>
    <description>&lt;P&gt;Without knowing exactly how your form is working you should be able to do this without the javascript function.&lt;/P&gt;&lt;P&gt;Inside the repeat add a field and use a concat function: name: teamlist&amp;nbsp; &amp;nbsp;calculation:&amp;nbsp; concat(${teammember_name},': ',${teammember_role})&amp;nbsp; This could be hidden and a null type field if you don't need to capture it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;outside the repeat: name: teamlist_join, calculation:&amp;nbsp; join(', ',${teamlist})&lt;/P&gt;&lt;P&gt;Make sure the field length outside the repeat has enough characters not to throw any errors, up it to like 1000 or more depending on your expectations of how long the "teamlist" could get.&lt;/P&gt;</description>
    <pubDate>Mon, 09 Jun 2025 15:09:34 GMT</pubDate>
    <dc:creator>Neal_t_k</dc:creator>
    <dc:date>2025-06-09T15:09:34Z</dc:date>
    <item>
      <title>Custom JS function behaving differently in webapp vs in Survey123 Connect</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/custom-js-function-behaving-differently-in-webapp/m-p/1621839#M62915</link>
      <description>&lt;P&gt;I'm wondering why my custom JS function to concatenate attributes of a repeat is working when I test in survey123 connect, but does not work when I open in the web app. I am attaching my function, as well as screenshots of the connect example and what happens in the web app. The calculation for the readonly question is:&amp;nbsp;&lt;/P&gt;&lt;TABLE width="558px"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="558px"&gt;pulldata("@javascript","functions.js","teamRepeatFunction",${project_team})&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The survey is not public, and is currently only shared with the owner.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;/*
 * JavaScript functions for Survey123
 */

function teamRepeatFunction(teamrepeat) {

 var teamlist = "";
 var i;
 for (i = 0; i &amp;lt; teamrepeat.length; i++) {
  
     teamlist = teamlist + teamrepeat[i].team_member_name+": " + teamrepeat[i].team_member_role + ", ";
   }

    return teamlist;
}&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 09 Jun 2025 14:54:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/custom-js-function-behaving-differently-in-webapp/m-p/1621839#M62915</guid>
      <dc:creator>GIS_utahDEM</dc:creator>
      <dc:date>2025-06-09T14:54:10Z</dc:date>
    </item>
    <item>
      <title>Re: Custom JS function behaving differently in webapp vs in Survey123 Connect</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/custom-js-function-behaving-differently-in-webapp/m-p/1621846#M62916</link>
      <description>&lt;P&gt;Without knowing exactly how your form is working you should be able to do this without the javascript function.&lt;/P&gt;&lt;P&gt;Inside the repeat add a field and use a concat function: name: teamlist&amp;nbsp; &amp;nbsp;calculation:&amp;nbsp; concat(${teammember_name},': ',${teammember_role})&amp;nbsp; This could be hidden and a null type field if you don't need to capture it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;outside the repeat: name: teamlist_join, calculation:&amp;nbsp; join(', ',${teamlist})&lt;/P&gt;&lt;P&gt;Make sure the field length outside the repeat has enough characters not to throw any errors, up it to like 1000 or more depending on your expectations of how long the "teamlist" could get.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jun 2025 15:09:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/custom-js-function-behaving-differently-in-webapp/m-p/1621846#M62916</guid>
      <dc:creator>Neal_t_k</dc:creator>
      <dc:date>2025-06-09T15:09:34Z</dc:date>
    </item>
  </channel>
</rss>

