|
POST
|
Recovery is not the issue - I've recovered the data. The issue is more of why this happened. The error indicates that the survey should be in the Outbox (or Draft or Sent), but the Outbox is not there - its bizarre.
... View more
04-21-2022
05:59 AM
|
0
|
0
|
1048
|
|
POST
|
Hi - Last night five users of the same survey experienced the same error using different iPads. The on-screen error, within the Inbox is: However, there is no Outbox or Draft folder (Sent is disabled): I checked the hosted feature layer and their partially completed surveys are there, however they can not recover the lost information, or access the Surveys in the Inbox. I am not having luck figuring out what is happening here. This has happened a few times before and it seems like if they go onto a different iPad, log in and refresh the Inbox, the survey appears (but is missing data). Any idea how to get Outbox/Drafts to show up or where I could recover the survey from? Should I be looking at the SQLite database? Thank you,
... View more
04-20-2022
05:05 AM
|
0
|
2
|
1112
|
|
POST
|
Hi @JamesTedrick - I know this post is years old, but hoping you see this. I am having the exact date issue as @JamesKelly4 in my Survey123 form - a DOB pulled in from a CSV file is 1 day off (always the day before). I used your XLSForm above as an example but this did not work - the incorrect date is still being pulled in. Do you have any suggestions? I am really struggling with this one. After adding all of these new fields/calculations into my XLSForm, this is what happens when I test. The date should be November 10, 1960. Thank you,
... View more
04-12-2022
06:16 AM
|
0
|
2
|
4865
|
|
POST
|
I was able to get some help and figure out how to do this. I wanted to post the result here in case it is helpful to others. I am using a custom JavaScript function and a series of hidden and relevant questions in the XLSForm to accomplish my goal - prevent the submission of a new Survey123 form if the file number entered is a duplicate value. First, here is the JS function: /*
* JavaScript functions for Survey123
*/
function returnFeatures(DCR_File_Number, token, debugmode) {
// Output value. Initially set to an empty string (XLSForm null)
let outValue = "";
let layerURL = "https://URL GOES HERE/FeatureServer/0";
let response ="";
// Set up query parameters
let f = "f=json";
let where = `where=DCR_File_Number='${DCR_File_Number}'`;
let outFields = "outFields=*";
let returnGeometry = "returnGeometry=false";
let returnCount = "returnCount=1";
let parameters = [f,where,outFields,returnGeometry,returnCount].join("&");
let url = `${layerURL}/query?${parameters}`;
if (token){
url = url + "&token=" + token;
}
// Create the request object
let xhr = new XMLHttpRequest();
// Make the request. Note the 3rd parameter, which makes this a synchronous request
xhr.open("GET", url, false);
xhr.send();
// Process the result
if (xhr.readyState === xhr.DONE) {
if (xhr.status !== 200) {
// The http request did not succeed
return "bad request: " + url
} else {
// Parse the response into an object
response = JSON.parse(xhr.responseText);
if (response.error) {
return (debugmode? JSON.stringify(response.error):"");
} else {
if (response.features[0]) {
return "DCR File number is not unique"
//JSON.stringify(response.features[0]);
} else {
if (DCR_File_Number !== "") {
return "DCR File number is unique"}
//(debugmode? "No Features Found":"");
}
}
}
}
} Next, I configured the XLSForm - here is what all of the populated columns look like (I hid all of the empty/non-relevant columns to fit this into one image): When the user goes to enter a file number, if it is invalid (AKA a duplicate), they will see this message in the Survey123 form: Because of line 6 in the XLSForm, they are prevented from submitting their form until they correct the DCR File Number so that it is unique. When a unique DCR File Number is entered, this message appears and the user is able to submit: This seems to work very well for my use case. Since this is a web-only form (users only complete from a desktop PC) this works perfectly.
... View more
03-28-2022
05:38 AM
|
3
|
4
|
4786
|
|
POST
|
Hi @ZhifangWang - The workaround appears to work. Any ETA for a push to production?
... View more
03-23-2022
08:26 AM
|
0
|
0
|
4831
|
|
BLOG
|
This is great! This is the final result for now: Thank you! 🙂
... View more
03-16-2022
11:49 AM
|
0
|
0
|
967
|
|
BLOG
|
@jcarlson - thanks for the reply. I actually had not seen that app, however it does not do what I am looking for. Really, what I want is to be able to use Arcade to just pop out a number of null attribute fields which I could add into a custom list. Then, when staff are looking at the list, they could see records that require review. I suppose I could accomplish this directly in Survey123 by adding a read-only field with a calculation of some sort that would count completed questions, however it would be nice to accomplish this without changing the survey form. I just do not know if Arcade can even do something like this. Something kind of like this:
... View more
03-16-2022
08:36 AM
|
0
|
0
|
979
|
|
BLOG
|
Hi @jcarlson - this is great. One question I have for you...have you ever thought about ways to add in some sort of way for your users to tell how complete a features attributes are? This is something I am trying to figure out now and thought I'd see if you had any thoughts.
... View more
03-16-2022
08:15 AM
|
0
|
0
|
986
|
|
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
|
4378
|
|
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
|
6686
|
|
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
|
1496
|
|
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
|
2729
|
|
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
|
2821
|
|
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
|
4456
|
|
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
|
4252
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 3 weeks ago | |
| 1 | 3 weeks ago | |
| 1 | 09-06-2022 09:14 AM | |
| 6 | 10-24-2024 12:04 PM | |
| 1 | 04-28-2021 09:14 AM |
| Online Status |
Offline
|
| Date Last Visited |
3 weeks ago
|