|
POST
|
@thesweenis - You can use custom JavaScript functions in your survey to parse a scanned drivers license into your Survey123 form. It works well, although sometimes the actual scanning process is a bit slow (still). Here is the js function which gets saved in your survey's "scripts" folder. function DL2JSON (data) {
var m = data.match(/^@\n\u001e\r(A....)(\d{6})(\d{2})(\d{2})(\d{2})/);
if (!m) {
return null;
}
var obj = {
header: {
IIN: m[2],
AAMVAVersion: parseInt(m[3]),
jurisdictionVersion: parseInt(m[4]),
numberOfEntries: parseInt(m[5])
}
};
for (var i = 0; i < obj.header.numberOfEntries; i++) {
var offset = 21 + i * 10;
m = data.substring(offset, offset + 10).match(/(.{2})(\d{4})(\d{4})/);
var subfileType = m[1];
var offset = parseInt(m[2]);
var length = parseInt(m[3]);
if (i === 0) {
obj.files = [ subfileType ];
} else {
obj.files.push(subfileType);
}
obj[subfileType] = data.substring(offset + 2, offset + length - 1).split("\n").reduce(function (p, c) {
p[c.substring(0,3)] = c.substring(3);
return p;
}, { } );
}
if (obj.DL) {
["DBA", "DBB", "DBD", "DDB", "DDC", "DDH", "DDI", "DDJ"].forEach(function (k) {
if (!obj.DL[k]) return;
m = obj.DL[k].match(/(\d{2})(\d{2})(\d{4})/);
if (!m) return;
obj.DL[k] = (new Date(m[3] + "-" + m[1] + "-" + m[2])).getTime();
} );
}
return JSON.stringify(obj);
} Here is the syntax for your XLSform which will parse the information into your form:
... View more
03-16-2022
07:55 AM
|
2
|
0
|
3623
|
|
POST
|
Hi - I am hoping to add some functionality into my XLSForm that would prevent data entry if a duplicate Project ID is entered into Survey123. I would like this to happen as soon as the user enters a Project ID into the form as the form is quite long (it would really stink to get to the end and then see this error!). I feel like a JavaScript function would be the best method for doing this, however I am struggling to find an example and really do not know how to write one myself. I do not think pulldata() would be a reasonable solution for this as it would be extremely cumbersome to maintain the external CSV - new projects are being entered weekly. The ideal solution would be a way to look back at the hosted feature service, check the field and see if the Project ID already exists. I am also wondering if the "Unique" setting could be used to accomplish this; I suspect that it would not cause error until going to submit the survey form. Any advice would be welcome! Thank you,
... View more
03-07-2022
01:36 PM
|
3
|
11
|
5587
|
|
POST
|
Hi Natalie - did you ever figure this out? I am also looking to do the same thing.
... View more
03-02-2022
11:05 AM
|
0
|
1
|
1337
|
|
POST
|
Hi @JohannesLindner - Thank you for the second expression - it works perfectly and is so short/elegant. I really appreciate your help with this.
... View more
02-24-2022
10:50 AM
|
0
|
0
|
2517
|
|
POST
|
Hi - I am trying to customize some pop-ups to show basic information from related tables. My hosted feature layer is set up so that there is a point layer with a series of 1:M relationships to related tables. Relationships are all based on GlobalID/GUID. There is a public version of the hosted feature layer here. I have two separate Arcade statements working properly, however it was not until I started configuring the pop-up that I realized these really should be combined into one expression so that the information returned in the pop-up makes sense. I am unsure of how to combine these. I want to to return either of the statements below based on the "Purpose" from the Road Infrastructure point layer. Return this expression if Pupose = Stream Crossing-B: // Access 'Bridge Inspections' table as a FeatureSet
var portal = Portal("https://www.arcgis.com")
var bridges = FeatureSetByPortalItem(portal,
"ae306d66da414b7f83f1c7db4284a632", 2, ['Inspection_Date',
'Condition_Overall', 'Inspector_Initials'])
// Filter related features by using a common attribute
var GLOBALID = $feature.GlobalID
var filterStatement = 'Bridge_GlobalID = @GlobalID'
// Related features as a variable
var relatedData = Filter(bridges, filterStatement)
// Sort related features by newest to oldest
var relatedDataSorted = OrderBy(relatedData, 'Inspection_Date DESC')
// Build the pop-up string by iterating through all related features
var popupString1 = '';
if (Count(relatedDataSorted)>0) {
// Get the first feature in the sorted FeatureSet
var f = First(relatedDataSorted);
// Build the pop-up string
popupString1 = DefaultValue(f.Condition_Overall, 'No Condition Recorded') + " " + Text(f.Inspection_Date, 'MM/DD/YYYY') + " by " + DefaultValue(f.Inspector_Initials, 'No Inspector Recorded')
}
DefaultValue(popupString1, 'No bridge inspections on record') Return this expression if Purpose = anything but Stream Crossing-B: // Access 'Culvert Inspections' table as a FeatureSet
var portal = Portal("https://www.arcgis.com")
var culverts = FeatureSetByPortalItem(portal,
"ae306d66da414b7f83f1c7db4284a632", 1, ['Inspection_Date',
'Condition_Overall', 'Inspector_Initials'])
// Filter related features by using a common attribute
var GLOBALID = $feature.GlobalID
var filterStatement = 'Culvert_GlobalID = @GlobalID'
// Related features as a variable
var relatedData = Filter(culverts, filterStatement)
// Sort related features by newest to oldest
var relatedDataSorted = OrderBy(relatedData, 'Inspection_Date DESC')
// Build the pop-up string by iterating through all related features
var popupString1 = '';
if (Count(relatedDataSorted)>0) {
// Get the first feature in the sorted FeatureSet
var f = First(relatedDataSorted);
// Build the pop-up string
popupString1 = DefaultValue(f.Condition_Overall, 'No Condition Recorded') + " " + Text(f.Inspection_Date, 'MM/DD/YYYY') + " by " + DefaultValue(f.Inspector_Initials, 'No Inspector Recorded')
}
DefaultValue(popupString1, 'No culvert inspections on record') This is what the pop-up looks like now with the two separate Arcade expressions - you can see how it doesn't make any sense. I'd like to only show the proper expression based on Purpose: I know I cannot use Arcade to call another expression, and I am guessing that I need to use some sort of if statement to get this working, but I really do not even know where to start. Any help would be very welcome!
... View more
02-18-2022
08:46 AM
|
0
|
2
|
2609
|
|
POST
|
Hi @ZacharySutherby @Anonymous User - A follow-up on input masks and Dashboards... has this been resolved? I apologize, but I am unclear from this thread. I have a Dashboard configured to edit existing Survey123 submissions - I've linked a list element with an embedded Survey123 form. I have one field in the Survey123 form that leverages an input mask. The data has been entered properly, but the field with the input mask shows up blank in the loaded form. If the form is edited and resubmitted, it appears that the stored value is kept (not nulled in the hosted feature layer). Here is an example - the field DCR File Number shows blank in the form on the right, but is included in the list to the left: This survey was published from Connect version 3.13.234. Thank you,
... View more
02-07-2022
12:42 PM
|
0
|
0
|
3666
|
|
POST
|
You were correct - I had not realized this was required now with Field Maps, as it wasn't when I'd previously configured these types of URLs for Collector. I was able to get some help via the Field Maps Questions and you can see the answer here - https://community.esri.com/t5/arcgis-field-maps-questions/custom-survey123-url-with-field-maps-callback/m-p/1140741#M2412
... View more
02-04-2022
06:07 AM
|
1
|
0
|
3922
|
|
POST
|
Thank you! I did not notice that, or know that %20 corresponded with a space. I appreciate the help. I do think a blog or something on this would be helpful for others though.
... View more
02-04-2022
05:26 AM
|
1
|
2
|
8700
|
|
POST
|
@Anonymous User - This is the encoded URL I am using - Survey123 launches from Field Maps just fine, but the callback doesn't happen. I submit the Survey and am returned to the Survey123 home instead of Field Maps. Any advice would be useful. arcgis-survey123://?portalUrl=https://www.arcgis.com&itemID=10242016ba5b4ab3883bf40bb8ae76fb&field:Ag_Guid={GlobalID}&callback=https%3A%2F%2Ffieldmaps.arcgis.app%20%2F%3FreferenceContext%3Dopen%26itemID%3D6b34dffb1c0b41b3907c61a97d0b1e4a Thank you,
... View more
02-03-2022
12:18 PM
|
0
|
5
|
8709
|
|
POST
|
Hi @Anonymous User - I will test this to see if it fixes my issue. If this is the recommended way of doing this, I would recommend an update to the documentation available on the Field Maps and Survey123 help pages because it is not clear at all. Thank you,
... View more
02-02-2022
09:44 AM
|
0
|
0
|
8725
|
|
POST
|
Hi - I am migrating some workflows from Collector to Field Maps and I am running into issues with my callback URL parameters. The workflow: Click a polygon feature in Field Maps to view pop-up. Custom pop-up displays URL to launch Survey123 form and pass certain attributes to Survey123. Survey is completed by user. When user submits survey, Field Maps re-opens via callback to specified map. This worked very well with Collector and was simple to configure. With Field Maps, I am getting some weird errors, even though I am following the documentation on both Survey123 and Field Maps help pages. If I use a URL formatted like below, I get an error when attempting to open Survey123 from the URL. The error is in Survey123 and says "Error Unpacking": https://survey123.arcgis.app/?itemID=10242016ba5b4ab3883bf40bb8ae76fb&field:Ag_Guid={GlobalID }&callback=https://fieldmaps.arcgis.app /?referenceContext=open&itemID=6b34dffb1c0b41b3907c61a97d0b1e4a This same error occurs when I modified the URL to be something like this: https://survey123.arcgis.app/?itemID=10242016ba5b4ab3883bf40bb8ae76fb&field:Ag_Guid={GlobalID}&callback=https://fieldmaps.arcgis.app://?referenceContext=open&itemID=6b34dffb1c0b41b3907c61a97d0b1e4a https://survey123.arcgis.app/?itemID=10242016ba5b4ab3883bf40bb8ae76fb&field:Ag_Guid={GlobalID}&callback=https://fieldmaps.arcgis.app//?referenceContext=open&itemID=6b34dffb1c0b41b3907c61a97d0b1e4a If I use the callback URL without the referenceContext parameter included, the callback seems to work, but does display an on-screen error when returning to Field Maps; this happens with either of the formats below: https://survey123.arcgis.app/?itemID=10242016ba5b4ab3883bf40bb8ae76fb&field:Ag_Guid={GlobalID }&callback=https://fieldmaps.arcgis.app ://?itemID=6b34dffb1c0b41b3907c61a97d0b1e4a https://survey123.arcgis.app/?itemID=10242016ba5b4ab3883bf40bb8ae76fb&field:Ag_Guid={GlobalID }&callback=https://fieldmaps.arcgis.app /?itemID=6b34dffb1c0b41b3907c61a97d0b1e4a Error: I did check and the Survey123 data submits properly. I am returned to the proper map in Field Maps, but see this error each time. Does anyone have advice on how to resolve this issue? Thank you,
... View more
02-01-2022
05:39 AM
|
0
|
14
|
10557
|
|
POST
|
Hi - I am migrating some workflows from Collector to Field Maps and I am running into issues with my callback URL parameters. The workflow: Click a polygon feature in Field Maps to view pop-up. Custom pop-up displays URL to launch Survey123 form and pass certain attributes to Survey123. Survey is completed by user. When user submits survey, Field Maps re-opens via callback to specified map. This worked very well with Collector and was simple to configure. With Field Maps, I am getting some weird errors, even though I am following the documentation on both Survey123 and Field Maps help pages. If I use a URL formatted like below, I get an error when attempting to open Survey123 from the URL. The error is in Survey123 and says "Error Unpacking": https://survey123.arcgis.app/?itemID=10242016ba5b4ab3883bf40bb8ae76fb&field:Ag_Guid={GlobalID }&callback=https://fieldmaps.arcgis.app /?referenceContext=open&itemID=6b34dffb1c0b41b3907c61a97d0b1e4a This same error occurs when I modified the URL to be something like this: https://survey123.arcgis.app/?itemID=10242016ba5b4ab3883bf40bb8ae76fb&field:Ag_Guid={GlobalID}&callback=https://fieldmaps.arcgis.app://?referenceContext=open&itemID=6b34dffb1c0b41b3907c61a97d0b1e4a https://survey123.arcgis.app/?itemID=10242016ba5b4ab3883bf40bb8ae76fb&field:Ag_Guid={GlobalID}&callback=https://fieldmaps.arcgis.app//?referenceContext=open&itemID=6b34dffb1c0b41b3907c61a97d0b1e4a If I use the callback URL without the referenceContext parameter included, the callback seems to work, but does display an on-screen error when returning to Field Maps; this happens with either of the formats below: https://survey123.arcgis.app/?itemID=10242016ba5b4ab3883bf40bb8ae76fb&field:Ag_Guid={GlobalID }&callback=https://fieldmaps.arcgis.app ://?itemID=6b34dffb1c0b41b3907c61a97d0b1e4a https://survey123.arcgis.app/?itemID=10242016ba5b4ab3883bf40bb8ae76fb&field:Ag_Guid={GlobalID }&callback=https://fieldmaps.arcgis.app /?itemID=6b34dffb1c0b41b3907c61a97d0b1e4a Error: I did check and the Survey123 data submits properly. I am returned to the proper map in Field Maps, but see this error each time. Does anyone have advice on how to resolve this issue? Thank you,
... View more
01-31-2022
07:23 AM
|
1
|
2
|
3989
|
|
IDEA
|
@Anonymous User - I am so used to the way Survey123 deals with this that it is really not an issue to me anymore as Survey123 is my agencies primary method of field data collection. That being said...anything that can be done to improve the experience in Field Maps would be welcome. I would only wonder for those workflows that might be migrated from Survey123 to Field Maps (if select multiple became available and the stored value method was different from how Survey123 does it), how would the data be affected? It seems content managers would need to do some work to fix things in the table.
... View more
01-06-2022
05:22 AM
|
0
|
0
|
5306
|
|
BLOG
|
@GlenShepherd @DerekMStrout - I would be very interested in learning more about that setting and how it can be used/affects Overwrite operations where View layers are in use. Also, @GlenShepherd - have there been any updates on the Esri end with regard to the broken/disconnected View issue I had posted questions about back in August 2021? I know some of the View experience was enhanced with the last release of AGOL, but I do not think this was addressed. Thank you!
... View more
01-05-2022
05:55 AM
|
0
|
0
|
13814
|
|
IDEA
|
@Anonymous User - Hoping to chime in here with some answers to your questions as this is something we'd also love to see implemented in Field Maps. If this was added, we'd be able to simplify some field workflows by removing the Survey123 component (which is used if we need to select multiple values). Survey123 implements this as a comma delimited list of values stored in a string field. This can make it difficult to re-use in other areas of ArcGIS. For those of you who use Survey123: How do you use the captured data for these fields? Do you show the layers in other apps/maps besides Survey123? Yes - we generally display collected data in Dashboards. Do you use hidden fields & calculations to split the choices into separate fields? No - we store the data as comma delimited and then work with it later using Arcade Data Expressions or something like R. Do you use Arcade in Pop-ups and Dashboards to format the data? Yes - we use Data Expressions in Dashboards to break the data out for charts. Would you expect to be able to create a multiple choice element for existing fields? Primarily this would be used to migrate existing (simple) workflows from Survey123 to Field Maps. We have existing domain values assigned already and would like to just "check off" a select multiple option to allow for multiple choices to be selected. Similar to the experience when building a Survey123 form in Connect "on top" of an existing feature layer. If so, do those fields have existing coded value domains? Are they string fields or integer fields? Yes to existing coded value domains - both string and integer fields, however string is much more common. Would it be beneficial to have a multiple choice UI/UX that stores each choice in a separate "boolean" field instead of a comma delimited list? I'd be interested to see how this would affect schema design. It sounds nice, but with the capabilities of Data Expressions, I am unsure if I'd give a hard and fast "yes" here without knowing more about how the schema is affected for existing data layers. How many choices per question are anticipated? I'd agree with @RogerCleaves1 that ~20 choices would be adequate when thinking of my existing workflows that I'd like to migrate. Would you need to add or remove choices over time? Potentially. If so, should that affect previously collected data? No - if a choice is added or removed, all existing data with that value should not be changed. Would you need to deprecate choices over time? Potentially - same response as above. Would you need to edit an existing choice name/values? Ideally not, but it is always possible. If so, should that affect previously collected data? It would be nice, but this can also be dealt with via Pro. Do the choices needs any additional information displayed with them, like a description? Or is the value/name enough? It would be ideal, in my opinion, to have a similar set up to Survey123 where you have the stored code and the label that is shown to the user in the application. If so, can you provide a specific example? We have coded values for our subbasins - 5 = Ball Brook. We don't want a list of numbers to show up for users, we want the list of labels that correspond. Another example would be for stream codes - the description is much more useful for field staff.
... View more
01-05-2022
05:39 AM
|
0
|
0
|
14681
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 09-06-2022 09:14 AM | |
| 6 | 10-24-2024 12:04 PM | |
| 1 | 04-28-2021 09:14 AM | |
| 3 | 09-06-2022 11:53 AM | |
| 1 | 01-17-2024 05:18 AM |
| Online Status |
Offline
|
| Date Last Visited |
02-14-2025
01:16 PM
|