BLOG
|
@timothycousins there is no need for a separate license to have Survey123 Connect on your computer. It is free to download, but you will need to login to an account (ArcGIS Online or ArcGIS Enterprise) in order to publish surveys.
... View more
11-18-2021
06:30 AM
|
0
|
0
|
8508
|
POST
|
@ClaytonBurns2 @MappyIan I have found a way to get this to work using the data expression: var assignments = FeatureSetByPortalItem(Portal('https://cotgis.maps.arcgis.com'), '31717adc351941d9a990f88e1049714c',0,);
var types = FeatureSetByPortalItem(Portal('https://cotgis.maps.arcgis.com'), '31717adc351941d9a990f88e1049714c',3);
var workers = FeatureSetByPortalItem(Portal('https://cotgis.maps.arcgis.com'), '31717adc351941d9a990f88e1049714c',1);
var dispatchers = FeatureSetByPortalItem(Portal('https://cotgis.maps.arcgis.com'), '31717adc351941d9a990f88e1049714c',2);
var filterAssignments = Filter(assignments,'status > 0')
function getTableValue(features, matchValue, matchField, returnFieldName){
for (var f in features){
if (f[matchField] == matchvalue){
return f[returnFieldName]
}
}
return "N/A"
}
var assign = {
fields: [
{ name: "description", type: "esriFieldTypeString" },
{ name: "status", type: "esriFieldTypeInteger" },
{ name: "statusdescript", type: "esriFieldTypeString" },
{ name: "notes", type: "esriFieldTypeString" },
{ name: "priority", type: "esriFieldTypeString" },
{ name: "assignmenttype", type: "esriFieldTypeGUID" },
{ name: "workorderid", type: "esriFieldTypeString" },
{ name: "duedate", type: "esriFieldTypeDate" },
{ name: "workerid", type: "esriFieldTypeGUID" },
{ name: "GlobalID", type: "esriFieldTypeGUID" },
{ name: "location", type: "esriFieldTypeString" },
{ name: "declinedcomment", type: "esriFieldTypeString" },
{ name: "assigneddate", type: "esriFieldTypeDate" },
{ name: "inprogressdate", type: "esriFieldTypeDate" },
{ name: "completeddate", type: "esriFieldTypeDate" },
{ name: "declineddate", type: "esriFieldTypeDate" },
{ name: "pauseddate", type: "esriFieldTypeDate" },
{ name: "dispatcherid", type: "esriFieldTypeGUID" },
{ name: "CreationDate", type: "esriFieldTypeDate" },
{ name: "Creator", type: "esriFieldTypeString" },
{ name: "EditDate", type: "esriFieldTypeDate" },
{ name: "Editor", type: "esriFieldTypeString" },
{ name: "Trash", type: "esriFieldTypeString" },
{ name: "Graffiti", type: "esriFieldTypeString" },
{ name: "PowerWash", type: "esriFieldTypeString" },
{ name: "AssignDescription", type: "esriFieldTypeString" },
{ name: "WorkerName", type: "esriFieldTypeString" },
{ name: "DispatcherName", type: "esriFieldTypeString" },
],
geometryType: "esriGeometryPoint",
features: [],
}
var FsFilter;
var i = 0
var epoch = Date(1970, 0, 01, 0, 0, 0, 0);
for (var f1 in filterAssignments){
var d = f1.assignmenttype
var code = f1.status
var codename = when(code==0,"Unassigned",code==1,"Assigned",code==2,"In Progress",code==3,"Completed",code==4,"Declined",code==5,"Paused",code==6,"Canceled","")
//return codename
FsFilter = Filter(types,'GlobalID like @d')
//return FsFilter;
for (var f2 in FsFilter){
var n = getTableValue(workers,f1.workerid,'globalid','name')
var o = getTableValue(dispatchers,f1.dispatcherid,'globalid','name')
var description;
// for (code in codes){
// if code.
// }
if(f2["description"]=='ada'){
description = upper(f2["description"])
}else{
description = proper(f2["description"])
}
assign.features[i++] = {
attributes: {
description: f1["description"],
status: f1["status"],
statusdescript: codename,
notes: f1["notes"],
priority: f1["priority"],
assignmenttype: f1["assignmenttype"],
workorderid: f1["workorderid"],
duedate: f1["duedate"],
workerid: f1["workerid"],
GlobalID: f1["GlobalID"],
location: f1["location"],
declinedcomment: f1["declinedcomment"],
assigneddate: DateDiff(f1["assigneddate"],epoch,'milliseconds'),
inprogressdate: DateDiff(f1["inprogressdate"],epoch,'milliseconds'),
completeddate: DateDiff(f1["completeddate"],epoch,'milliseconds'),
declineddate: DateDiff(f1["declineddate"],epoch,'milliseconds'),
pauseddate: DateDiff(f1["pauseddate"],epoch,'milliseconds'),
dispatcherid: f1["dispatcherid"],
CreationDate: DateDiff(f1["CreationDate"],epoch,'milliseconds'),
Creator: f1["Creator"],
EditDate: DateDiff(f1["EditDate"],epoch,'milliseconds'),
Editor: f1["Editor"],
Trash: f1["Trash"],
Graffiti: f1["Graffiti"],
PowerWash: f1["PowerWash"],
AssignDescription: description,
WorkerName: n,
DispatcherName: o
},
geometry: Geometry(f1)
};
}
}
// }
//return assign
return FeatureSet(Text(assign)); Using the geometryType of "esriGeometryPoint" (line 48) and adding in the geometry: Geometry(feature) (line 106) tag in the dictionary before converting the feature set worked for me. I'd be curious to see if this works for either of you.
... View more
11-15-2021
07:03 PM
|
3
|
2
|
1539
|
BLOG
|
@hgaignard I am trying to do this as well within integromat using ArcGIS Enterprise with the following parameters: But when I try and run the scenario and parse the response using the JSON as you described above, I am getting the following error: Any thoughts on why this is happening? Thanks!
... View more
11-25-2020
11:52 AM
|
0
|
0
|
7371
|
POST
|
By definition, anytime you have a hidden field, this will default to a string field and thus not allow you to publish if the existing field is not a string.
... View more
11-13-2019
01:13 PM
|
0
|
0
|
268
|
POST
|
We encountered a similar issue when dealing with a select_one where we wanted an integer field bounded. The work around we found here was to publish a referenced feature service with the appropriate data type for the respective field and then utilize the submission URL in the survey to publish it to Portal.
... View more
08-26-2019
02:48 PM
|
1
|
0
|
2487
|
Title | Kudos | Posted |
---|---|---|
3 | 11-15-2021 07:03 PM | |
1 | 08-26-2019 02:48 PM |
Online Status |
Offline
|
Date Last Visited |
12-14-2023
04:07 PM
|