Hello:
Any advice on how to prepolute a survey with both a csv and a feature class that will share a common field? I have seen inserting a link in a web map pop up to use feature class fields and using pulldata to use the csv. What is the best way to combine both?
Workforce for ArcGIS
Are the two related using a relationship class? If so you can enable fields from the related csv/table on the pop up of the feature class and then send it all from there. It for sure will work as a related table.
You could also use Arcade to calculate in the Feature class pop up then send that value. (note this does not work in collector yet so maybe not an option -works in a browser though)
Here is some sample code I use to go find the matching records in the current map. In this case I report issues (only on plots with a status Eval) but you could grab data. (also esri why no Arcade syntax option?)
<SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN>$feature<SPAN class="punctuation token">.</SPAN>EvalStatus <SPAN class="operator token">==</SPAN> <SPAN class="string token">"Eval"</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN> var sql <SPAN class="operator token">=</SPAN> <SPAN class="string token">"PlotKey = '"</SPAN> <SPAN class="operator token">+</SPAN> $feature<SPAN class="punctuation token">.</SPAN>PlotKey <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">"Plot Observation"</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="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN>tblCnt <SPAN class="operator token"><</SPAN> <SPAN class="number token">1</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN> <SPAN class="keyword token">return</SPAN> <SPAN class="string token">"\n----No Plot Observation form found!"</SPAN> <SPAN class="punctuation token">}</SPAN> <SPAN class="keyword token">else</SPAN> <SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN>tblCnt <SPAN class="operator token">></SPAN> <SPAN class="number token">1</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN> <SPAN class="keyword token">return</SPAN> <SPAN class="string token">"\n----More than 1 Plot Observation form found!"</SPAN> <SPAN class="punctuation token">}</SPAN> <SPAN class="keyword token">else</SPAN> <SPAN class="punctuation token">{</SPAN> <SPAN class="keyword token">return</SPAN> <SPAN class="string token">''</SPAN> <SPAN class="punctuation token">}</SPAN> <SPAN class="punctuation token">}</SPAN> <SPAN class="keyword token">else</SPAN> <SPAN class="punctuation token">{</SPAN> <SPAN class="keyword token">return</SPAN> <SPAN class="string token">''</SPAN> <SPAN class="punctuation token">}</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
Slightly more complicated example where I go grab some data from a diff table and check the data pattern.
<SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN>$feature<SPAN class="punctuation token">.</SPAN>EvalStatus <SPAN class="operator token">==</SPAN> <SPAN class="string token">"Eval"</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN> var sql <SPAN class="operator token">=</SPAN> <SPAN class="string token">"PlotKey = '"</SPAN> <SPAN class="operator token">+</SPAN> $feature<SPAN class="punctuation token">.</SPAN>PlotKey <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">"LPI"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">,</SPAN> sql<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> var txt <SPAN class="operator token">=</SPAN> <SPAN class="string token">''</SPAN> <SPAN class="keyword token">for</SPAN> <SPAN class="punctuation token">(</SPAN>var f in <SPAN class="token function">OrderBy</SPAN><SPAN class="punctuation token">(</SPAN>tbl<SPAN class="punctuation token">,</SPAN><SPAN class="string token">"LineNumber"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN> txt <SPAN class="operator token">=</SPAN> txt <SPAN class="operator token">+</SPAN> f<SPAN class="punctuation token">.</SPAN>LineNumber <SPAN class="operator token">+</SPAN> <SPAN class="string token">' '</SPAN> <SPAN class="punctuation token">}</SPAN> txt <SPAN class="operator token">=</SPAN> <SPAN class="token function">Left</SPAN><SPAN class="punctuation token">(</SPAN>txt<SPAN class="punctuation token">,</SPAN><SPAN class="token function">Count</SPAN><SPAN class="punctuation token">(</SPAN>txt<SPAN class="punctuation token">)</SPAN><SPAN class="operator token">-</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN>txt <SPAN class="operator token">!=</SPAN> <SPAN class="string token">'1 2 3'</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN> <SPAN class="keyword token">return</SPAN> <SPAN class="string token">"\n----LPI Line Number Issue! Found: "</SPAN> <SPAN class="operator token">+</SPAN> txt <SPAN class="punctuation token">}</SPAN> <SPAN class="keyword token">else</SPAN> <SPAN class="punctuation token">{</SPAN> <SPAN class="keyword token">return</SPAN> <SPAN class="string token">''</SPAN> <SPAN class="punctuation token">}</SPAN> <SPAN class="punctuation token">}</SPAN> <SPAN class="keyword token">else</SPAN> <SPAN class="punctuation token">{</SPAN> <SPAN class="keyword token">return</SPAN> <SPAN class="string token">''</SPAN> <SPAN class="punctuation token">}</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.