|
POST
|
Is it possible to use 1 map file (vtpk.) across multiple Surveys for use offline? Many of our new surveys will need to be offline enabled and I'd rather not have to make our users download an offline map file for each survey they download.
... View more
10-23-2024
05:47 AM
|
0
|
3
|
1851
|
|
POST
|
Thanks for the suggestions, but I think I'm taking your other approach and avoiding it too. The user will just have to do the extra 1 or 2 taps/clicks on this case. At least the majority of scenarios only have 1 choice and it's not a massive form so not a big case for taps minimisation.
... View more
10-21-2024
03:18 PM
|
1
|
0
|
4037
|
|
POST
|
Hi Team. I'm trying to make my form a little smarter. I have 2 fields: Type and Subtype. Some hazard types have only 1 matching Subtype, whereas others have multiple to pick from. I want my subtype field to automatically fill out the only available value when there is only 1 value to pick from, but be blank when multiple options are available. Is this possible? I tried this with Copilot but failed as it tried using Count which I believe is for repeats only, then tried another approach but that also failed (see Copilot outputs below). Method 1: Prepare Your CSV File: Ensure your CSV file is structured with columns for the key and the values you want to pull. For example: key,value
A1,Option1
A2,Option2
A2,Option3 Load the CSV File: Use the pulldata function to load the values from the CSV file based on the answer in Field A. Create a Calculation Field: Add a calculation field to determine the number of options available for Field B based on the answer in Field A. <- this is the step that threw an error in Survey123 Connect type name label calculation
calculate options_count Options Count count(pulldata('csv_file', 'value', 'key', ${field_a})) Set Up Field B: Use the relevant column to control the visibility of Field B and the default column to set its default value. type name label relevant default
select_one field_b Field B ${options_count} > 0 if(${options_count} = 1, pulldata('csv_file', 'value', 'key', ${field_a}), '') Filter Choices for Field B: Use the choice_filter column to filter the choices for Field B based on the answer in Field A. type name label choice_filter
select_one field_b Field B key = ${field_a} In this setup: The options_count field calculates the number of options available for Field B. The relevant column ensures Field B is only shown if there are options available. The default column sets the default value of Field B to the single option if only one is available, otherwise it remains blank. The choice_filter column filters the choices for Field B based on the answer in Field A Method 2: Prepare Your CSV File: Ensure your CSV file is structured properly with columns for the key and values. Use pulldata to Retrieve Values: Use the pulldata function to fetch the values from the CSV file. <- this step failed to return all the values, just the first value, thus never generating a reliable count Calculate the Number of Matching Choices: Use a calculation field to determine the number of matching choices. Set Default Value Conditionally: type name label calculation
calculate matching_values Matching Values pulldata('csv_file', 'value', 'key', ${field_a})
calculate count_values Count Values if(${matching_values} != '', count-selected(${matching_values}), 0)
text field_b Field B if(${count_values} = 1, ${matching_values}, '') In this setup: matching_values retrieves the values from the CSV file based on the answer in Field A. count_values calculates the number of matching values. field_b sets the default value to the single matching value if only one is found, otherwise it remains blank.
... View more
10-20-2024
11:28 PM
|
1
|
2
|
4107
|
|
POST
|
Right - so here's where I've landed on a final product (with findings thrown in around the issues I faced). I have adopted your suggestion @ChristopherCounsell to use an integer field to create the initial hazard number (Hazard_Num) as well as maintained my previous text field (Hazard_ID). When a form is submitted through Survey123, the Hazard_Num is null and the Hazard_ID is defaulted to "NEW". Both are hidden in the survey so this is all in the background. When the entry is reviewed by our OSHE team using experience builders Edit widget, there are now 2 separate calcs running. 1st - the Hazard_Num field runs: // Check if Hazard_ID is empty
if (IsEmpty($feature.Hazard_Num)) {
// Query all features to find the highest Hazard_Num
var allFeatures = OrderBy($layer, 'Hazard_Num DESC');
var highestFeature = First(allFeatures);
// Calculate the new Hazard_Num
var newHazardID = highestFeature.Hazard_Num + 1;
return newHazardID;
} else {
// Retain the current Hazard_Num
return $feature.Hazard_Num;
} 2nd - the Hazard_ID field runs: // Check if Hazard_ID is new
if ($feature.Hazard_ID == "NEW" ||IsEmpty($feature.Hazard_ID)) {
// Get Hazard Number
var HazNum = $feature.Hazard_Num;
// Calculate new Hazard_ID
var newHazardID = "HAZ - " + Text(HazNum, "000");
return newHazardID;
} else {
// Retain the current Hazard_ID
return $feature.Hazard_ID;
} Findings - the main issue I was running into was that the "for" loop flat-out refused to work with the text field. Even with the "Haz - " component being removed and formatting the values as numbers, it just kept returning errors. By breaking it out into 2 parts, I can now generate a unique, incrementing number at the point of review by the OSHE team for features with no number (null), and that value is then pulled and calculated into a pretty Text string in the ID field. Any value previously updated (no longer equals "NEW") gets retained as is. Any value added in manually by the OSHE team is also captured and created by the IsEmpty function.
... View more
10-14-2024
06:39 PM
|
1
|
0
|
2824
|
|
POST
|
Thanks for the tips - definitely going to include the $originalfeature context. Still working on the rest of it but it's all helping out.
... View more
10-14-2024
12:58 AM
|
0
|
0
|
2841
|
|
POST
|
Hi Josh. Thanks for your suggestions. They could potentially work, though it's possible a feature could be deleted if something is submitted by accident. I've been experimenting since my original post, so I'm confident the loop part is OK, but it can't actually access the layer to do the loop. I had the same concern about the loop getting large and slow over time so added in a filter prior to only get the last month of records which should keep it manageable. Just need to find a way to get it to read the whole layer in the first place. I've just tried this but still no joy: var features = FeatureSetByName($map, 'Form FPC94 Hazard Report - OSHE Review', ['Hazard_ID'], false);
... View more
10-11-2024
08:00 AM
|
0
|
0
|
2885
|
|
POST
|
Pretty sure the problem is with the FeatureSetById. I've also tried FeatureSetByPortalItem but not having any luck in getting it to look at the features in the layer. Thats the point I've managed to get it to work up to. What am I doing wrong here? That is my layer name as per the map layers.
... View more
10-11-2024
01:29 AM
|
0
|
0
|
2899
|
|
POST
|
I am trying to use the below Arcade code to generate a new incremental ID value for features in a layer when edited in Experience Builder. Features are typically submitted via Survey123 with a default value of "NEW". Once submitted, our OHS people review them in Experience Builder and edit the feature to show they have done so. The below is a calculation applied in Field Maps Designer that "should" check all features in the layer, find the highest existing ID value (e.g. HAZ - 095) and calculate a new ID value (e.g. HAZ - 096). This also needs to happen if a new feature is created in Experience Builder (which would have an empty value instead of "NEW"). If a feature has been previously edited and has an "HAZ - ###" value, then it should be retauned. Can anyone show me whats going wrong? Currently all NEW or blank values are being calculated as "HAZ - 001" and exisiting values are being returned correctly. // Fetch the current value of the field
var currentValue = $feature["Hazard_ID"];
// Check if the current value is "NEW" or blank
if (currentValue == "NEW" || IsEmpty(currentValue)) {
// Fetch all features to determine the latest number
var features = FeatureSetById($map, 'Form FPC94 Hazard Report - OSHE Review', ['Hazard_ID'], false);
var maxNumber = 0;
// Iterate through features to find the highest number
for (var f in features) {
var value = f["Hazard_ID"];
if (Find("HAZ - ", value) == 0) {
var number = Number(Mid(value, 6));
if (number > maxNumber) {
maxNumber = number;
}
}
}
// Increment the highest number by 1
var newNumber = maxNumber + 1;
// Format the new number with leading zeros
var formattedNumber = Text(newNumber, "000");
// Return the new value
return "HAZ - " + formattedNumber;
} else {
// Return the current value if it's not "NEW" or blank
return currentValue;
}
... View more
10-10-2024
06:03 PM
|
0
|
6
|
2928
|
|
BLOG
|
Can someone please confirm for me if I have a vtpk set as Linked Content against 2 or more surveys, will those surveys all reference the one downloaded file in the Survey123 app or will each survey need the file to be downloaded independently? I can't find a definitive answer anywhere. Copilot is telling me thats how it should work. UPDATE (April 2025) - No, files are not reused across Surveys. Each Survey requires offline maps to be downloaded again, and again, and again...
... View more
10-08-2024
09:01 PM
|
1
|
0
|
9710
|
|
POST
|
Have you checked your ArcGIS Online subscription for outstanding subscription payments? Even with an extension approved by Esri, we found this issue occurred up until payment was made and the sub renewed.
... View more
10-07-2024
05:55 PM
|
0
|
0
|
4432
|
|
BLOG
|
@AlixVezina Great little video. I've learnt something new from it - how to use the $editContext vs $originalFeature thingo's.
... View more
10-06-2024
08:48 PM
|
0
|
0
|
9311
|
|
IDEA
|
I've found similar problems with items like GetUser() to return a users First and Last names. It works in Field Maps when Online, but not when Offline, and so I need to split the actual Username value (that does return when offline) and then format and Concatenate the values to get first, last or full names. Would be nice if the Online vs Offline functionality was also documented clearly.
... View more
09-29-2024
10:32 PM
|
0
|
0
|
1563
|
|
IDEA
|
Currently, the Spatial Join tool in ArcGIS Pro contains the Match Option "Have their center in" which calculates a features center (centroid) and uses that to match the target feature. My idea is to add the option to "Have their INSIDE center in", or maybe a conditional check box that appears when the "Have their center in" option is selected that forces an "Inside" calculation. Currently, a Spatial Join with this Match option selected would return the Default option shown in the graphic below. I then have to add a search distance to get the polygon to select correctly, but this also has risks of selecting the wrong feature should another feature exist close by. Have the option to force "Inside" centroid calculation would ensure we get the match we desire. This functionality already exists in the "Add Geometry Attributes" GP tool.
... View more
09-25-2024
06:59 PM
|
11
|
3
|
6385
|
|
POST
|
Early 2025 now - Really looking forward to shutting down our old WAB Apps so I'm not running parallel apps!
... View more
09-25-2024
06:40 PM
|
3
|
0
|
1332
|
|
BLOG
|
Love seeing how GIS manifests itself through so many varied disciplines.
... View more
09-24-2024
06:56 PM
|
1
|
0
|
599
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | yesterday | |
| 2 | a week ago | |
| 3 | 2 weeks ago | |
| 3 | 2 weeks ago | |
| 2 | 2 weeks ago |
| Online Status |
Offline
|
| Date Last Visited |
yesterday
|