POST
|
Number selectors always operate in a way that ignores nulls. You could get around this with a Grouped Values selector looking at the same field. This might result in gaps in the numeric range for values not present in the data, and also means you can't use a nice "slider" selector, but it would preserve nulls in the data.
... View more
a month ago
|
0
|
3
|
210
|
POST
|
I like a good GroupBy statement in a Data Expression, as it evaluates a lot faster than feature by feature. We also want this information to be available for filtering other widgets in your dashboard, so we need to keep the objectid or globalid in the output. Inside of the GroupBy expression, we can also use some basic SQL. In this case, we use "CASE WHEN <condition> THEN <result> ELSE <fallback> END". It could be a long expression, but essentially, anything null counts as 1, non-nulls as 0, and the final value will be the number of null fields. Anything above 0 meets your criteria for "incomplete". The output of this expression will have one row for every feature in the layer, and you should be able to use it to filter other widgets accordingly. If you'd rather just have an expression that evaluates to "complete" or "incomplete", that's also possible with some adjustments to the SQL. var fs = FeatureSetByPortalItem(
Portal('your portal url'),
'itemid of the layer',
0, // layer index
['objectid'], // since we are using GroupBy, we don't need any fields in the FS
false
)
var sql = `
CASE WHEN first_field IS NULL THEN 1 ELSE 0 END +
CASE WHEN second_field IS NULL THEN 1 ELSE 0 END +
CASE WHEN third_field IS NULL THEN 1 ELSE 0 END
`
// group by objectid to keep every feature separate in the output
return GroupBy(
fs,
'objectid',
{
name: 'null_fields',
expression: sql,
statistic: 'SUM'
}
)
... View more
a month ago
|
1
|
0
|
182
|
POST
|
For whatever reason, it's just not seeing attachments on the feature, if there are any. Are you using a View Layer? It's possible to have a view layer that doesn't expose the attachments of the source data. I would open the data table in your Portal to confirm that there are attachments on the features. I'd also take a look at the layer properties in Pro, just to make sure that Pro and Portal are referencing the same exact data source. If you're using views, or if you published the layer from Pro, it's possible that they're not looking at the same data.
... View more
a month ago
|
0
|
0
|
243
|
POST
|
And you can confirm that there are actually attachments on the given feature? Try adding the count of the attachments array to the output, just to check. When you create the array, put the count in as the first item: var link_arr = [`${Count(attachs)} attachments:`] Do you see a count of items? Also, try putting some static text in the HTML. The attachments ought to all have names, but if the attname variable were empty, the link wouldn't render. var link = `<a href="${atturl}" target="_blank">File: ${attname}</a>` Any change?
... View more
a month ago
|
0
|
2
|
250
|
POST
|
Hard to say, but I think the href needs double quotes? The way Pro evaluates popups is very different from the web map sometimes. Here are a couple things to try: First, push your attachment URLs into an array, then use Concatenate to return a formatted block of text. Second, use template literals to build your HTML strings. This will avoid any issues with quotation marks. var layer = "https://somserver.com/server/rest/services/mylayer/myfeature_PT/MapServer/0/"
var attachs = Attachments($feature)
var foid = $feature.objectid
var link_arr = []
for(var a in attachs) {
var atturl = `${layer}${foid}/attachments/${attachs[a].id}`
var attname = attachs[a].name
var link = `<a href="${atturl}" target="_blank">${attname}</a>`
Push(link_arr, link)
}
var links = Concatenate(link_arr, '<br>')
return {
type : 'text',
text : links
}
... View more
a month ago
|
0
|
4
|
259
|
POST
|
What's the context for the expression? Is it in an Arcade popup element, or just a standalone expression that shows up as a field? Is it the new map viewer, or the classic one? Any chance the data is public?
... View more
a month ago
|
0
|
1
|
201
|
POST
|
It's easier than you think! There's a function, DateAdd, which can add a specified interval to a given date. You can also use the Text function to apply your preferred formatting to a datetime value. var last_insp = $feature['lastinspection']
var next_insp = DateAdd(last_insp, 3, 'months')
return `Next Inspection: ${Text(next_insp, 'MMM | D')}`
... View more
a month ago
|
2
|
1
|
189
|
POST
|
Unfortunately, your field formatting in Excel doesn't matter. When AGOL reads in your file, it does it all as text, then makes its best guess about the field types based on their contents. The best way to go about this, in my opinion, is to create an empty layer with the schema you want first, then use the contents of your file to append records to it.
... View more
a month ago
|
1
|
0
|
140
|
POST
|
On line 10, you have an else if that isn't followed by a {…} of any kind. You need to combine your conditions into a single statement, you can't just put two "else if" statements back to back. Same goes for the first set of if statements. Try combining your conditions like this: //Meters less than or equal to 1.0 inches and installed less than or equal to 15 years ago
if (($feature.metersize_inches <= '1.0') && (DateDiff(Now(), Date($feature.installdt), 'year') <= 15)) {
return "Small Meters installed up to 15 years ago"
}
//Meters greater than or equal to 1.5 inches and installed less than or equal to 10 years ago
else if (($feature.metersize_inches >= '1.5') && (DateDiff(Now(), Date($feature.installdt), 'year') <= 10)) {
return "Large Meters installed up to 10 years ago"
}
//Time since meter installation is none of these
else {
return "None of these"
} Edit: conditions should be AND (&&) not IF.
... View more
03-18-2024
07:39 AM
|
0
|
1
|
284
|
POST
|
Does the device / user switch happen at defined points? I think using multiple forms for the different sections could be a workable solution.
... View more
03-18-2024
06:37 AM
|
0
|
0
|
124
|
POST
|
How do you mean? Would this be a single user switching devices, or multiple users dividing up the survey? There are lots of ways to collaborate and work on the same data in Survey123, but which route you go really depends on what you need the process to accomplish and how you want it to function. You could have the different sections as entirely separate forms, which you could edit through the field app's Inbox.
... View more
03-18-2024
06:23 AM
|
0
|
2
|
128
|
POST
|
I don't know about a way to do it within the API, but you could just use requests to ping the service endpoints and parse the response.
... View more
03-15-2024
07:56 AM
|
0
|
0
|
118
|
POST
|
It's a method on the GeoAccessor, Esri's version of a spatial dataframe. https://developers.arcgis.com/python/api-reference/arcgis.features.toc.html#geoaccessor You can also use pandas.DataFrame.compare() to compare two dataframes, but it operates differently.
... View more
03-15-2024
07:54 AM
|
0
|
0
|
153
|
POST
|
Can you share the formatting you have on the HTML? Hard to diagnose what's going on without that.
... View more
03-14-2024
01:07 PM
|
0
|
1
|
137
|
POST
|
Given that it would edit your features in place, it would work quite well. Some of our layers we update this way are used in an offline capacity, and there is no issue. When the source data has adds or deletes, those are made, everything else is simply edited in place or left alone, so any internal fields used to link features to the offline copy would still be in place.
... View more
03-14-2024
01:03 PM
|
0
|
2
|
179
|
Title | Kudos | Posted |
---|---|---|
1 | 03-05-2024 09:51 AM | |
1 | 12-01-2023 02:25 PM | |
3 | Friday | |
1 | 01-14-2022 02:36 PM | |
3 | a week ago |
Online Status |
Online
|
Date Last Visited |
Friday
|