I have created Arcade expressions that display pop-up data from a related table using FeatureSets. They work in ArcGIS Online but not in Collector. Does Collector (the new iOS version) support FeatureSets?
Got it working.Just incase anyone runs into this post and is wondering I ended up needing to wrap the $feature.globalid with the Upper() function. The character values in my GlobalIDs were returning in lower case in Field Maps but the actual GlobalID values have upper case characters.
var sql = "rel_globalid = '" + Upper($feature.globalid) + "'"; var tbl = Filter(FeatureSetByName($map,"Bridge Attributes", ['*'], false), sql); var val = '' for (var row in tbl){ val += row.client_name } return val
I have brought this up in the past they all thought I was nuts!
https://community.esri.com/t5/arcgis-pro-questions/globalid-inconsistent-display/td-p/291405
and
https://community.esri.com/t5/arcgis-survey123-questions/globalid-in-lowercase-from-collector-to-survey123-windows-tablet/m-p/822843
Yet another reason to not use globalids.
Thanks Doug,
Ugh, it looks like $feature.globalid (or $feature.GlobalID) can't be used in the Filter function sql when consumed by Field Maps. If I hardcode in a GlobalID it works and if I filter using another field it works.
Very annoying.Mark
Hmm looks ok. Only other thing I can think of is in AGOL the case is usually GlobalID (not globalid). Check the exact case sensitive of yours and see. Make sure to check the real name and not the alias.
I personally never use GlobalID for the relate for the reasons listed here
https://community.esri.com/t5/arcgis-collector-questions/related-tables-for-offline-data-collection/td-p/92900
Thanks Doug,Interesting that it is working for you...I updated the expression as you suggested and am still seeing a blank return in Field Maps.
var sql = "rel_globalid = '" + $feature.globalid + "'"; var tbl = Filter(FeatureSetByName($map,"Bridge Attributes", ['*'], false), sql); var val for (var row in tbl){ val = row.client_name } return val
When I update the expression to not include the Filter function it works.
var sql = "rel_globalid = '" + $feature.globalid + "'"; var tbl = FeatureSetByName($map,"Bridge Attributes", ['*'], false); var val for (var row in tbl){ val = row.client_name } return val
I am using Filter like this and it works in Field Maps. Looks like your SQL maybe formatted wrong.
var sql = "PointID = '" + $feature.PointID + "'"; var tbl = Filter(FeatureSetByName($map,"Points", ['*'], false), sql); var val for (var row in tbl) { val = row.DesignLat } return val
Hope that helps.
Is there a list of arcade functions that are supported in Field Maps documented anywhere? FeatureSet does seem to be working but if I have the Filter() function as part of my expression it returns blank.
// Acess 'Bridge Attributes' table as a FeatureSet var bridgeAttributes = FeatureSetByName($map, "Bridge Attributes", ['*']) // Filter related features by using globalid var GlobalID = $feature.globalid var filterStatement = 'rel_globalid = @Globalid' // Related features as a variable var relatedData = Filter(bridgeAttributes, filterStatement) // Build the pop-up string by iterating through all related features var popupString = '' for (var f in relatedData){ popupString += DefaultValue(f.client_name, 'no data') + TextFormatting.NewLine + "Bridge Name: " + DefaultValue(f.bridge_name_num, 'no data') + TextFormatting.NewLine } return popupString
This expression works fine in the web map but returns blank in Field Maps...
Note FeatureSet is now working in Field Maps.
The Collector team told me that no new features will be added to Collector now. They are going to put all the time into Field Maps. The first version of Field Maps is supposed to have FeatureSet in it. But I did some of the beta testing in early adopter and it still does not seem to work. Supposed to release some today or tomorrow so maybe then.
I will update when I get something working. The relationship attributes still seem to not work also, no work on that one.
I really wish they would have got at least FeatureSet in Collector that was due by Dec 2019. I am nervous to move to Field Maps by May since it is still beta. We just changed from Classic to Collector this year so hard to change again.
Any update on this?
Anyone still having this issue? I followed these steps https://community.esri.com/community/gis/web-gis/arcgisonline/blog/2018/12/10/overlapping-features-in-pop-ups-quick-introduction-to-using-featuresets-with-arcade executed perfectly, works great on web map, but doesn't load in collector. Is this a ticket I need to make? arcade collector
dan becker
"Downfall is that you can't take the map offline in Collector So close..."
I've been trying to figure out for the past few hours how to bring my map offline. My web map contains layers with fields having attribute expressions that use FeatureSetByName. Is this the reason I haven't been able to figure out? Does Collector work online only in this case?
My use case is checking to see if all 12 forms have been filled out at a location. I have relationship classes that ties them all together. I can check for 0 counts or even look for a pattern of 1-2-3. For now it only works in the browser.
I could also do some of this using the built in relationship pop values but those do not work either. I have posted about this issue several times over the last year or so.
Then what I would really love is if they all worked offline without having the sync 123 to Collector but that would require the new 123 API prob. We would like them to get a message before they leave the sample site since, once they leave, it is too late. True app integration is the next step I think. Imagine loading a TPK once and using it in all Esri apps (vs having the same TPK on there 3 times).
Access to the relationship classes in Arcade would also be nice. The only reason i really need FeatureSet in the first place is to simulate a relationship class lookup with a query. I think relationships classes are a great part of Arc products but it seems to get very little support.
Thanks for looking at it.
Thanks Jeff. This is great news.
We are trying to pass attributes to Survey123 that are derived based on a spatial intersect in a webmap. I can do this perfectly from the desktop, but I need to be able to do this from Collector to S123 in the field, offline.
Thank you. Very much looking forward to this functionality.
Jeff,
Thanks for this update! I think first and foremost we would like to see featuresetby functioning in collector.
My specific use case:
We have sites where multiple types of inspections take place via survey123. It would be nice to use featuresetby to status each of these inspections in the popup for each site.
Thanks for the comments in this thread, both good and snarky.
We have a lot of exciting new development coming with data collection, Forms, Arcade, and Attribute Rules. Some good news is that FeatureSets have made their way into the released version of ArcGIS Runtime 100.8 so we can start to build against them now. We are also working on a new feature form or "smart form" that introduces grouping, conditional visibility (using Arcade expressions), proper setting of required fields and much more. We'll be kicking off a beta program of this new forms capability later in the summer. We'll be announcing the first phase of the beta program in a couple of weeks.
Attribute rules are also important in our future - they need to execute on the client. There is some additional plumbing to be done to fully support both of these though (both in Hosted Feature Services and Runtime).
I'd love to know what workflows you are trying to solve. It will help us in prioritizing some of the work. Can you comment?
Hi Dan, I am trying to get ANYTHING to work at this point. Seems that even the Sum($layer,'field') function doesn't work. I cant get FeatureSetByRelationshipName to work, either. Do you have sample code that you can provide for what you were successful with? I, very simply, need to summarize data. This is maddening! I am using the new version of Collector on an iPad.
FeatureSetByRelationshipName() works in Collector. I just setup an Attribute rule calculation that queryies the parent layer in the relationship and populates attributes on the child record accordingly.
Downfall is that you can't take the map offline in Collector So close...
I have been informed that this is being actively worked on for ArcGIS Runtime 100.8 Releases of Esri field apps should pick this up later this year.
-mark
Yes, we are excited for the functionality as well. Please upvote this to your development team.
Kevin and Doug,
I have reproduced what you are experiencing with Featuresets and also found out that is scheduled to be implemented in Esri Runtime update 6 which is in development and planned for summer/fall release.... and then the Esri Field Apps will need to be released on the update 6 runtime, so it will be a little while before we see Featureset"" functionn working in Collector.
Mark
Is it possible to access a {relationships/1/objectid} field in Arcade?
Can I access other Arcade expressions? Like {expression/expr0} ?
I would like to have a master check like If {expression/expr0} == 1 and {expression/expr1} == 1 and etc}
Arcade will not let me use {} at all so how do i access these fields?
Thanks
Yes I am using that version. Also tried the recent beta.
Other stuff works just not FeatureSetByName.
Also Relationship counting does not work
The newest new version.. ... if you check out this post from Jeff Shaner https://www.esri.com/arcgis-blog/products/collector/field-mobility/collector-for-arcgis-beta-updates/
It mentions that that the Collecor IOS V19.1.0 beta update includes support for Arcade Expressions.
Same question. I switched mine to use $map so it theory it should work. But I just get blank.
<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">"GAP"</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">"LineKey"</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> <SPAN class="token function">Right</SPAN><SPAN class="punctuation token">(</SPAN>f<SPAN class="punctuation token">.</SPAN>LineKey<SPAN class="punctuation token">,</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">)</SPAN> <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">"\nLine 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>
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.