POST
|
My brain can't handle the no-braces version, I keep forgetting it actually works!
... View more
3 weeks ago
|
0
|
0
|
302
|
POST
|
Your expression needs some brackets on it in order to flow properly. for(var i in street) {
if(i.Street_ID == SID) {
return i.St_Name
} else {
return {"errorMessage": "Street ID does not exist"}
}
} You could probably streamline this by filtering the streets table, instead of looping through all the streets looking for a match one-by-one. And when your condition is either/or, you can use Iif instead of a conditional block. var street = FeatureSetByName($datastore, 'tStreet', ['Street_ID', 'St_Name'], false)
var SID = $feature['St_ID']
var matches = Filter(street, "Street_ID = @Sid") // or if the St_ID is a string, "Street_ID = '@SID'"
// check if any matches. grab name if yes, return error if no
return Iif(
Count(matches) > 0,
First(matches)['St_Name'],
{'errorMessage': 'Street ID does not exist'}
)
... View more
3 weeks ago
|
0
|
3
|
309
|
POST
|
It's just key/value pairs, not a real schema, so I don't believe it supports aliases. Whatever you put as the key, that's what is shown in the chart. As long as you close it in quotes, there's no reason your key can't have spaces, though:
... View more
3 weeks ago
|
0
|
0
|
103
|
POST
|
Oh man, a blast from the past. This happened to us once, too. I don't remember how the issue was resolved, though... Do you see anything helpful in the Network tab of your browser's developer tools? (Assuming you are submitting from the web form.)
... View more
3 weeks ago
|
0
|
2
|
344
|
POST
|
The short answer is "no". If it's possible, you can try to alter the Data Expression in such a way to get all the widgets to pull from a single data source.
... View more
4 weeks ago
|
0
|
1
|
143
|
POST
|
Any chance the layers are in the same geodatabase? You could try using $datastore in the FeatureSetByName, rather than $layer or $map.
... View more
4 weeks ago
|
0
|
1
|
176
|
POST
|
Where are you trying to use this expression? Referencing other layers with Arcade functions a little differently in ArcGIS Pro compared to the web. If the DEM polygons are a published service, I'd suggest using FeatureSetByPortalItem instead, as it will work regardless of whether the layer is present in the map, and works the same in Pro or the web.
... View more
4 weeks ago
|
0
|
3
|
188
|
POST
|
It would probably be best to post this as its own question, and include the expression you've got so far.
... View more
4 weeks ago
|
1
|
0
|
81
|
POST
|
I'm specifically not using the Python API, and I am my org's admin. Or do you mean like a system login, not a built-in user?
... View more
4 weeks ago
|
0
|
0
|
160
|
POST
|
In the function Date, the second parameter is the month number, but it's zero-indexed. Meaning 0 = January, etc. So 8 is September.
... View more
4 weeks ago
|
1
|
2
|
337
|
POST
|
Yarg. Nothing seems to work. Server settings even show "isAdminEnabled": true, so I'm not sure what else is going on. Thanks for you help, though!
... View more
4 weeks ago
|
1
|
0
|
193
|
POST
|
Yeah, that's exactly the sort of stuff I'm looking to do. I'll take a closer look at the token, but it seems to work fine for everything else I do, whether that's editing the server / site configuration, make edits to feature services, do administrative tasks on the Portal. Happy to hear it's possible, though! Gives me motivation to keep figuring it out.
... View more
4 weeks ago
|
1
|
2
|
201
|
POST
|
I'm using HTTP POST requests directly to the URL, complete with a valid administrator token. What kinds of tasks are you performing?
... View more
4 weeks ago
|
1
|
4
|
205
|
POST
|
Evidently "DES" is totally fine with Arcade! It gets weirder and funnier. Literally any text after the field name besides "ASC" is treated as "DESC". A typo on "DESC" is fine. But a typo on "ASC" will give you the opposite!
... View more
4 weeks ago
|
0
|
1
|
376
|
POST
|
Honestly, I don't see anything wrong with your expression here, except maybe your OrderBy function needs a "C" on "DES"? Attribute rules are supposed to have access to all FeatureSet functions. You're saying that the expression doesn't work in the web map or Field Maps, just in the expression builder? Two suggestions: First, include more parameters on your FeatureSetByRelationshipName function. By specifying the fields you want and not including any geometry, less data will be going back and forth, which would speed up a slow expression. Second, maybe just try some debugging. Add Console statements to your expression, then open your browser's Developer Tools and watch the "Console" tab and see what it says. var relatedrecords = OrderBy(
FeatureSetByRelationshipName(
$feature,
"BaitStation_Checks",
['DateChecked'],
false
),
"DateChecked DESC"
);
var cnt = Count(relatedrecords);
Console('related record count', cnt);
var relatedinfo = "";
if (cnt > 0) {
var info = First(relatedrecords);
Console(info)
relatedinfo = Text((info.DateChecked), "ddd DD/MM/YYYY");
}
return DefaultValue(relatedinfo, "No checks to date")
... View more
4 weeks ago
|
0
|
0
|
379
|
Title | Kudos | Posted |
---|---|---|
1 | Thursday | |
1 | Thursday | |
1 | Thursday | |
1 | Monday | |
1 | Tuesday |
Online Status |
Offline
|
Date Last Visited |
Wednesday
|