Hello, I am working on a citizen science project where we need at least 3 surveys completed at 45 different lakes. We are using survey123 and AGOL to try and create a map showing how many surveys have been conducted and how many surveys are needed. We have successfully joined the survey feature layer with a point layer (representing each of the 45 lakes) with success and have been able to write an Arcade expression to show how many surveys have been completed in the popup.
We would now like to label this Joined Feature using the same Arcade expression used in cinfig pop-up. But it does not work with the message "Parse Error:featuresetbyname is not available". Any thoughts on this issue would be much appreciated. The following is the code we use to to see the number of surveys submitted at each lake.
var sql <SPAN class="operator token">=</SPAN> <SPAN class="string token">"selectTerritory = '"</SPAN> <SPAN class="operator token">+</SPAN> $feature<SPAN class="punctuation token">.</SPAN>selectTerritory <SPAN class="operator token">+</SPAN> <SPAN class="string token">"'"</SPAN><SPAN class="punctuation token">;</SPAN>
var tbl <SPAN class="operator token">=</SPAN> <SPAN class="token function">Filter</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="token function">FeatureSetByName</SPAN><SPAN class="punctuation token">(</SPAN>$map<SPAN class="punctuation token">,</SPAN><SPAN class="string token">"Survey123Form_July2019_ForNPS - surveyPoint"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">,</SPAN> sql<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
var tblCnt <SPAN class="operator token">=</SPAN> <SPAN class="token function">count</SPAN><SPAN class="punctuation token">(</SPAN>tbl<SPAN class="punctuation token">)</SPAN>
<SPAN class="token function">When</SPAN><SPAN class="punctuation token">(</SPAN>tblCnt <SPAN class="operator token"><</SPAN> <SPAN class="number token">3</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"#FF0000"</SPAN><SPAN class="punctuation token">,</SPAN> tblCnt <SPAN class="operator token">==</SPAN> <SPAN class="number token">4</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"#FFFF00"</SPAN><SPAN class="punctuation token">,</SPAN> tblCnt <SPAN class="operator token">==</SPAN> <SPAN class="number token">5</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"#FFFF00"</SPAN><SPAN class="punctuation token">,</SPAN>tblCnt <SPAN class="operator token">==</SPAN> <SPAN class="number token">6</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"#FFFF00"</SPAN><SPAN class="punctuation token">,</SPAN>tblCnt <SPAN class="operator token">==</SPAN> <SPAN class="number token">7</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"#FFFF00"</SPAN><SPAN class="punctuation token">,</SPAN>tblCnt <SPAN class="operator token">></SPAN> <SPAN class="number token">8</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"#008000"</SPAN><SPAN class="punctuation token">,</SPAN> null<SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">return</SPAN> tblCnt<SPAN class="operator token">-</SPAN><SPAN class="number token">1</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>