|
POST
|
Hi Xander Bakker - thanks, thats exactly what I'm looking for, except I want the expression on the Product Commission ITP layer..
... View more
08-09-2020
04:56 PM
|
0
|
1
|
1441
|
|
POST
|
Hi Xander Bakker Assets are the production database layer which has geography.
... View more
08-07-2020
05:42 PM
|
0
|
3
|
1441
|
|
POST
|
Hi Xander Bakker I have updated my script with changes to the way I find related features and how date to text is formatted, but I still get the same result. As above, my script is located on the product commission ITP layer because this is where the specific record of the activity related to the vehicle stop exists. Apologies, my code is untidy. var Asset;
var DateOfVisit;
var IntersectCount;
var result;
var VehicleIntersecting;
var FirstAsset;
var AssetGeometry;
var AssetArea;
var Buffer_Distance = 100;
var AssetID;
//Get Date of Commission
var DateOfCommission = Left(Text($feature.CreationDate),10);
Console(DateOfCommission);
//Get Bay ID and set Query
//var BayID = $feature["bay_guid"];
//Console("BayID = " + BayID);
//var QueryBay = "GlobalID = '" + BayID + "'";
//var QueryAsset;
//Console("QueryBay = " + QueryBay);
// Get Associated Bay Record
var Bay = FeatureSetByRelationshipName($feature, 'Bay');
Console("Bay record = " + Bay)
Console("Bay record count = " + Count(Bay))
// Find GUID of Associated Asset Record and Set Query
//for (var FilteredBay in Bay) {
// var AssetID = FilteredBay.asset_guid
// Console("AssetID = " + AssetID);
// var QueryAsset = "GlobalID = '" + AssetID +"'";
// Console("QueryAsset = " + QueryAsset);
// Get Associated Asset Record
var Asset = FeatureSetByRelationshipName(First(Bay), 'Assets');
Console("Asset record = " + Asset);
// Use first record (never more than one) and get geometry
// var FirstAsset = First(Asset)
var AssetGeometry = Geometry(First(Asset));
Console("Asset Geometry is " + AssetGeometry);
// Buffer 50m around Asset
var Asset_Area = Buffer(First(Asset), Buffer_Distance, 'meters');
Console("Asset Area is " + Asset_Area);
// Find Vehicles that intersect Asset Buffer
var VehicleIntersecting = Intersects(FeatureSetById($map, /* Vehicle Locations */ "Vehicle_Locations_8121"), Asset_Area);
var IntersectCount = count(VehicleIntersecting);
Console("Intersect Count = " + IntersectCount);
// If an intersecting vehicle record is found
if (IntersectCount > 0) {
for (var VehicleStop in VehicleIntersecting) {
//Get Date of Visit
var DateOfVisit = Left(Text(VehicleStop.date_visited),10);
Console("Date of Visit = " + DateOfVisit);
Console("Date of Commission = " + DateOfCommission);
// Set result as Visit Duration if Dates of Visit and Commission Match
if (DateOfVisit == DateOfCommission) {
var result = "Visit Duration = " + VehicleStop.visit_duration;
}
}
} else {
var result = "No Intersecting Vehicle Record Found"
}
//}
return result;
... View more
08-05-2020
04:45 PM
|
0
|
5
|
3861
|
|
POST
|
Hi Xander Bakker Thanks for taking a look. In response to your questions: None of the feature layers has any arcade expression defined. The expression was on the product commission ITP layer. Where should the sequence begin? When you click on a feature of the "Production database" layer? When a specific product commission ITP record is clicked I did not see a layer that has a field called "bay_guid", so it fails at line 18: $feature["bay_guid"] The field exists in the product commission ITP layer I might try to make some changes to the script you wrote and see how I go. If you have any advice that would be greatly appreciated.
... View more
08-05-2020
12:40 AM
|
0
|
0
|
3861
|
|
POST
|
Xander Bakker - note, for the record that the script editor tests there is not a corresponding vehicle record.
... View more
08-03-2020
04:30 PM
|
0
|
8
|
3861
|
|
POST
|
Xander Bakker Thank you so much for your help. I'm very keen to resolve this issue. Apologies that my code is a little rough. So now I have: var Asset;
var DateOfVisit;
var IntersectCount;
var result;
var VehicleIntersecting;
var FirstAsset;
var AssetGeometry;
var AssetArea;
var Buffer_Distance = 100;
var AssetID;
//Get Date of Commission
var DateOfCommission = Text($feature.CreationDate);
Console(DateOfCommission);
//Get Bay ID and set Query
var BayID = $feature["bay_guid"];
Console(BayID);
var QueryBay = "GlobalID = @BayID";
var QueryAsset;
Console(QueryBay);
// Get Associated Bay Record
var Bay = Filter(FeatureSetById($map, /* Production_database - Bay */ "Production_database_3775"), QueryBay);
Console(Bay)
// Find GUID of Associated Asset Record and Set Query
for (var FilteredBay in Bay) {
var AssetID = FilteredBay.asset_guid
Console(AssetID);
var QueryAsset = "GlobalID = @AssetID";
Console(QueryAsset);
// Get Associated Asset Record
var Asset = Filter(FeatureSetById($map, /* Production_database */ "Production_database_8049"), QueryAsset);
Console(Asset);
// Use first record (never more than one) and get geometry
var FirstAsset = First(Asset)
var AssetGeometry = Geometry(FirstAsset);
Console(AssetGeometry);
// Buffer 50m around Asset
var Asset_Area = Buffer(FirstAsset, Buffer_Distance, 'meters');
Console(Asset_Area);
// Find Vehicles that intersect Asset Buffer
var VehicleIntersecting = Intersects(FeatureSetById($map, /* Vehicle Locations */ "Vehicle_Locations_8121"), Asset_Area);
var IntersectCount = count(VehicleIntersecting);
Console(IntersectCount);
// If an intersecting vehicle record is found
if (IntersectCount > 0) {
for (var VehicleStop in VehicleIntersecting) {
//Get Date of Visit
var DateOfVisit = Text(VehicleStop.date_visited);
Console(DateOfVisit);
Console(DateOfCommission);
Console(result);
// Set result as Visit Duration if Dates of Visit and Commission Match
if (DateOfVisit == DateOfCommission) {
var result = "Visit Duration = " + VehicleStop.visit_duration;
} else {
var result = "No Vehicle Data Found"
}
}
} else {
var result = "No Intersecting Vehicle Record Found"
}
}
return result; Tests ok, same as previously. The Console output is now: 2020-07-21T10:36:28+10:00 5c8fad47-691a-467c-a542-dc8014eadd1e GlobalID = @BayID object, FeatureSet dba7142e-50bd-43d8-9a3a-c7859a419fd1 GlobalID = @AssetID object, FeatureSet {"spatialReference":{"latestWkid":3857,"wkid":102100},"x":16259374.139800005,"y":-4055441.0997} {"spatialReference":{"latestWkid":3857,"wkid":102100},"rings":[[[16259474.139800005,-4055441.0997],[16259473.92569233,-4055447.640012923],[16259473.284286141,-4055454.152319222],[16259472.218328046,-4055460.6087322016],[16259470.732382633,-4055466.9816045105],[16259468.832812954,-4055473.2436465304],[16259466.527753256,-4055479.3680432364],[16259463.827074157,-4055485.328569022],[16259460.742340382,-4055491.0997],[16259457.286761235,-4055496.6567233023],[16259453.475134034,-4055501.975842901],[16259449.323780753,-4055507.03428151],[16259444.850478124,-4055511.810378119],[16259440.074381515,-4055516.283680748],[16259435.015942905,-4055520.435034029],[16259429.696823306,-4055524.2466612305],[16259424.139800005,-4055527.7022403786],[16259418.368669027,-4055530.7869741535],[16259412.408143241,-4055533.4876532513],[16259406.283746535,-4055535.7927129497],[16259400.021704515,-4055537.692282629],[16259393.648832206,-4055539.1782280407],[16259387.192419227,-4055540.2441861373],[16259380.680112928,-4055540.885592324],[16259374.139800005,-4055541.0997],[16259367.599487081,-4055540.885592324],[16259361.087180782,-4055540.2441861373],[16259354.630767804,-4055539.1782280407],[16259348.257895494,-4055537.692282629],[16259341.995853474,-4055535.7927129497],[16259335.871456768,-4055533.4876532513],[16259329.910930982,-4055530.7869741535],[16259324.139800005,-4055527.7022403786],[16259318.582776703,-4055524.2466612305],[16259313.263657104,-4055520.435034029],[16259308.205218494,-4055516.283680748],[16259303.429121885,-4055511.810378119],[16259298.955819257,-4055507.03428151],[16259294.804465976,-4055501.975842901],[16259290.992838774,-4055496.6567233023],[16259287.537259627,-4055491.0997],[16259284.452525852,-4055485.328569022],[16259281.751846753,-4055479.3680432364],[16259279.446787056,-4055473.2436465304],[16259277.547217377,-4055466.9816045105],[16259276.061271964,-4055460.6087322016],[16259274.995313868,-4055454.152319222],[16259274.35390768,-4055447.640012923],[16259274.139800005,-4055441.0997],[16259274.35390768,-4055434.559387077],[16259274.995313868,-4055428.047080778],[16259276.061271964,-4055421.5906677986],[16259277.547217377,-4055415.21779549],[16259279.446787056,-4055408.95575347],[16259281.751846753,-4055402.831356764],[16259284.452525852,-4055396.8708309783],[16259287.537259627,-4055391.0997],[16259290.992838774,-4055385.542676698],[16259294.804465976,-4055380.2235570992],[16259298.955819257,-4055375.1651184903],[16259303.429121885,-4055370.3890218814],[16259308.205218494,-4055365.915719252],[16259313.263657104,-4055361.764365971],[16259318.582776703,-4055357.95273877],[16259324.139800005,-4055354.4971596217],[16259329.910930982,-4055351.412425847],[16259335.871456768,-4055348.711746749],[16259341.995853474,-4055346.4066870506],[16259348.257895494,-4055344.507117371],[16259354.630767804,-4055343.0211719596],[16259361.087180782,-4055341.955213863],[16259367.599487081,-4055341.313807676],[16259374.139800005,-4055341.0997],[16259380.680112928,-4055341.313807676],[16259387.192419227,-4055341.955213863],[16259393.648832206,-4055343.0211719596],[16259400.021704515,-4055344.507117371],[16259406.283746535,-4055346.4066870506],[16259412.408143241,-4055348.711746749],[16259418.368669027,-4055351.412425847],[16259424.139800005,-4055354.4971596217],[16259429.696823306,-4055357.95273877],[16259435.015942905,-4055361.764365971],[16259440.074381515,-4055365.915719252],[16259444.850478124,-4055370.3890218814],[16259449.323780753,-4055375.1651184903],[16259453.475134034,-4055380.2235570992],[16259457.286761235,-4055385.542676698],[16259460.742340382,-4055391.0997],[16259463.827074157,-4055396.8708309783],[16259466.527753256,-4055402.831356764],[16259468.832812954,-4055408.95575347],[16259470.732382633,-4055415.21779549],[16259472.218328046,-4055421.5906677986],[16259473.284286141,-4055428.047080778],[16259473.92569233,-4055434.559387077],[16259474.139800005,-4055441.0997]]]} 0 Results still the same in the data table and the popup
... View more
08-03-2020
03:05 PM
|
0
|
11
|
3861
|
|
POST
|
Hi Zachary Sutherby and mark dynge Thanks for your replies. Here's my assumption of what has happened: 1/ Field technician correctly completes and submits survey from field app 2/ Field technician re-opens sent survey in field app, makes changes and notices that status field still says "draft" (this field changes automatically via an Integromat scenario), so changes to "submitted" before submitting again 3/ When the survey sees this field is "submitted" it hides all the fields with ${status}!='submitted' in the relevant column 4/ Re-sent survey therefore misses all of these fields and overwrites the existing record 5/ Data gone I have since edited my surveys to have the status field hidden and am not aware of a problem since.
... View more
08-01-2020
08:07 PM
|
0
|
0
|
955
|
|
POST
|
Hi James Tedrick Thanks for the advice. In the end we discovered it was multiple image placeholders wrapped by ${if} statements on the same line of the template. When moved to separate lines the statements worked as expected. I requested that this error be picked up by the syntax check in future.
... View more
08-01-2020
07:59 PM
|
0
|
0
|
1317
|
|
POST
|
Updated code: var Asset;
var DateOfVisit;
var IntersectCount;
var result;
var VehicleIntersecting;
var FirstAsset;
var AssetGeometry;
var AssetArea;
var Buffer_Distance = 100;
var AssetID;
//Get Date of Commission
var DateOfCommission = Text(Date(year($feature.CreationDate),month($feature.CreationDate),day($feature.CreationDate)));
Console($feature.CreationDate);
Console(DateOfCommission);
//Get Bay ID and set Query
var BayID = $feature["bay_guid"];
Console(BayID);
var QueryBay = "GlobalID = '" + BayID + "'";
var QueryAsset;
Console(QueryBay);
// Get Associated Bay Record
var Bay = Filter(FeatureSetById($map, /* Production_database - Bay */ "Production_database_3775"), QueryBay);
Console(Bay)
// Find GUID of Associated Asset Record and Set Query
for (var FilteredBay in Bay) {
var AssetID = FilteredBay.asset_guid
Console(AssetID);
var QueryAsset = "GlobalID = '" + AssetID + "'";
Console(QueryAsset);
// Get Associated Asset Record
var Asset = Filter(FeatureSetById($map, /* Production_database */ "Production_database_8049"), QueryAsset);
Console(Asset);
// Use first record (never more than one) and get geometry
for (var FilteredAsset in Asset) {
var FirstAsset = First(Asset)
var AssetGeometry = Geometry(FirstAsset);
Console(AssetGeometry);
// Buffer 50m around Asset
var Asset_Area = Buffer(FirstAsset, Buffer_Distance, 'meters');
Console(Asset_Area);
// Find Vehicles that intersect Asset Buffer
var VehicleIntersecting = Intersects(FeatureSetById($map, /* Vehicle Locations */ "Vehicle_Locations_8121"), Asset_Area);
var IntersectCount = count(VehicleIntersecting);
Console(IntersectCount);
// If an intersecting vehicle record is found
if (IntersectCount > 0) {
for (var VehicleStop in VehicleIntersecting) {
//Get Date of Visit
var DateOfVisit = Text(Date(year(VehicleStop.date_visited), month(VehicleStop.date_visited), day(VehicleStop.date_visited)));
Console(DateOfVisit);
Console(DateOfCommission);
Console(result);
// Set result as Visit Duration if Dates of Visit and Commission Match
if (DateOfVisit == DateOfCommission) {
var result = "Visit Duration = " + VehicleStop.visit_duration;
} else {
var result = "No Vehicle Data Found"
}
}
} else {
var result = "No Intersecting Vehicle Record Found"
}
}
}
return result; Result in Script Editor (correct): Result in Data Table: Popup is empty. Please help!!
... View more
08-01-2020
07:53 PM
|
0
|
13
|
3862
|
|
POST
|
I'm trying to cross reference work done on a site by the amount of time a vehicle was there. I have this Arcade script, which tests ok in the script editor but on the map data table shows Data Error and in the popup is null. Here's the script, can anyone please help to debug? var Asset; var DateOfVisit; //Get Date of Commission, add to result var DateOfCommission = Date(year($feature.CreationDate),month($feature.CreationDate),day($feature.CreationDate)); var result = "Date Of Commission = " + DateOfCommission; Console($feature.CreationDate); Console(DateOfCommission); var VehicleIntersecting; var FirstAsset; var AssetGeometry; var AssetArea; var Buffer_Distance = 100; var AssetID; var BayID = $feature["bay_guid"]; Console(BayID); var QueryBay = "GlobalID = '" + BayID + "'"; var QueryAsset; Console(QueryBay); // Get Associated Bay Record var Bay = Filter(FeatureSetById($map, /* Production_database - Bay */ "Production_database_3775"), QueryBay); Console(Bay) // Find GUID of Associated Asset Record for (var FilteredBay in Bay) { var AssetID = FilteredBay.asset_guid Console(AssetID); var QueryAsset = "GlobalID = '" + AssetID + "'"; Console(QueryAsset); // Get Associated Asset Record var Asset = Filter(FeatureSetById($map, /* Production_database */ "Production_database_8049"), QueryAsset); Console(Asset); for (var FilteredAsset in Asset) { var FirstAsset = First(Asset) var AssetGeometry = Geometry(FirstAsset); Console(AssetGeometry); //Buffer 50m around Asset var Asset_Area = Buffer(FirstAsset, Buffer_Distance, 'meters'); Console(Asset_Area); //Find Vehicles that intersect Asset Bugger var VehicleIntersecting = Intersects(FeatureSetById($map, /* Vehicle Locations */ "Vehicle_Locations_8121"), Asset_Area); for (var VehicleStop in VehicleIntersecting) { //Get Date of Visit var DateOfVisit = Date(year(VehicleStop.date_visited), month(VehicleStop.date_visited), day(VehicleStop.date_visited)); Console (DateOfVisit); Console (DateOfCommission); // Add Date of Visit to Result var result =+ " //// Date Of Visit = " + DateOfVisit; Console(result); //Add Visit Duration if Dates of Visit and Commission Match if (DateOfVisit == DateOfCommission) { var result =+ " //// Visit Duration = " + VehicleStop.visit_duration; } } } } return result;
... View more
07-31-2020
07:54 PM
|
0
|
21
|
5966
|
|
POST
|
Hi, Today I am seeing a new problem. User in the field has completed a survey with all required fields as per the xlsform, then sent. Send is successful, a new object appears in the table but this object does not have all the data that was on the completed survey. I know this must be an error in transmission somewhere because most of the missing data is for fields with required set to 'yes' on the xlsform, so would not be able to be sent without it being populated in the field app. Getting frustrated with the number of roadblocks!! Please help?
... View more
06-17-2020
08:04 PM
|
0
|
3
|
1020
|
|
POST
|
Please could someone look into this issue? As yet I have not been able to generate any feature reports via Integromat or the Survey123 application. All templates and all records affected. Organisation hasn’t 6000 credits remaining.
... View more
06-15-2020
02:05 PM
|
1
|
0
|
840
|
|
POST
|
I use Integromat to generate feature reports automatically. Scenario is tested and works fine. This weekend nothing will successfully generate feature reports. Instead I get the message “prepareFailed”. Same result in Survey123 when I try to generate manually. What’s the issue?
... View more
06-13-2020
05:40 PM
|
1
|
1
|
887
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 04-29-2020 05:04 PM | |
| 1 | 02-09-2022 02:13 PM | |
| 1 | 06-15-2020 02:05 PM | |
| 1 | 06-13-2020 05:40 PM | |
| 2 | 07-19-2021 03:09 PM |
| Online Status |
Offline
|
| Date Last Visited |
07-20-2021
11:58 PM
|