|
POST
|
With this week's update to Arcade and ArcGIS Dashboards, this issue is fixed. Dates in feature sets now just work. You no longer have to wrap dates with Number() if you pass the dictionary into the FeatureSet() function (which as of this release accepts a dictionary as opposed to only text based JSON). Instead of: return FeatureSet(Text(dict)) Do this: return FeatureSet(dict) Learn more on this blog post. NOTE: For Enterprise users, this update is targeted for 11.2
... View more
06-15-2023
12:15 PM
|
1
|
0
|
2121
|
|
BLOG
|
@jcarlson, thank you for the detailed guide and tips for data expressions. Regarding the nuance with date fields, an enhancement has just been rolled out this week. You no longer have to convert them to EPOCH with the Number() function. You just have to make the following change. Instead of: return FeatureSet(Text(dict)) Do this: return FeatureSet(dict) Learn more on this blog post. NOTE: For Enterprise users, this update is targeted for 11.2
... View more
06-15-2023
12:04 PM
|
0
|
0
|
2726
|
|
IDEA
|
@jzibbell_boise, with this week's update to Arcade and ArcGIS Dashboards, this issue is fixed. Dates in feature sets now just work. You no longer have to wrap dates with Number() if you pass the dictionary into the FeatureSet() function (which as of this release accepts a dictionary as opposed to only text based JSON). Instead of: return FeatureSet(Text(dict)) Do this: return FeatureSet(dict) Learn more on this blog post. NOTE: For Enterprise users, this update is targeted for 11.2
... View more
06-15-2023
11:57 AM
|
0
|
0
|
4317
|
|
BLOG
|
With this past release of Arcade, the FeatureSet() function now accepts dictionaries. You may be familiar with writing the following on the last line of your data expression. return FeatureSet(Text(dict)) This was because the FeatureSet() function only accepted JSON as text as an input. Now you can update this to... return FeatureSet(dict) Why is this important, you might ask. For one, it offers a performance gain. Secondly, it addresses an issue that many of you have asked to fix: Allow Date() values in date fields (esriFieldTypeDate) When you create a feature set using the old technique, the Text() function converts Arcade dates to an ISO8601 string. However, the FeatureSet() constructor from JSON text needs an EPOCH value. So, in the past you had to wrap your dates with a Number() function (e.g., Number(Now())) before you constructed your feature set. And, if you didn’t, you’d end up with what looked like a zero-row feature set returned. Now that FeatureSet() accepts dictionaries, dates don’t have to be cast to EPOCH. For example, the following will now execute and return a valid feature set. var dict = { fields: [{ name: "DateField", type: "esriFieldTypeDate" }], features: [{ attributes: { DateField: Now() } }], geometryType: "" }; return FeatureSet(dict); That’s a wrap. Keep creating amazing dashboards. Note for Enterprise users: This update is targeted for the 11.2 release. For previous versions you will have to utilize a technique of wrapping your dates in Number() to convert them to EPOCH and wrap your dictionary in Text() (e.g., FeatureSet(Text(myDict)) ). See this post for more detail.
... View more
06-15-2023
06:39 AM
|
8
|
3
|
5340
|
|
POST
|
Hi John, I'm not familiar with the specifics on Arcade functions in Enterprise for the popup profile. But, in testing it, it appears not to be listed.
... View more
05-11-2023
01:54 PM
|
1
|
0
|
1053
|
|
IDEA
|
Hi @JohannesLindner , Thank you for digging all these up and helping users with many of them. I have brought it to the attention of the Arcade team and they will discuss it. It sounds like there are some complexities around the feature layer specification (requiring EPOCH) and time zones (e.g., an Arcade date is in local time), but that is not to say a solution cannot be had. I'll keep you posted. For the time being, I thought I'd share a little helper function to convert dates in a feature to EPOCH. I will have to check if it is accounting for time zone correctly though. // Since a esriTypeDate can't take an Arcade Date, need to cast to EPOCH
// Pass in a feature
function CastDatesToEpoch(feat) {
var modifiedAttributes = {};
for (var att in feat) {
if(TypeOf(feat[att]) == 'Date') {
modifiedAttributes[att] = Number(feat[att])
// Console(`${feat[att]} is now ${Number(feat[att])}`)
}
else {
modifiedAttributes[att] = feat[att]
}
}
return modifiedAttributes
}
var fs = FeatureSetByPortalItem(Portal('https://www.arcgis.com'), item, sublayer, ["*"], fetchGeom);
// Define a new dictionary feature set
var sch = Schema(fs);
var dict = {
'fields': sch.fields,
'geometryType': sch.geometryType, // Can be esriGeometryNull, esriGeometryPoint, esriGeometryPolyline, esriGeometryPolygon;
'features': []
};
// Do something to each feature, like add a field, then add it to the dictionary
var index = 0;
for (var f in fs) {
// Add each feature to new dictionary and cast dates to EPOCH
dict.features[index] = {
'geometry': Geometry(f),
'attributes': CastDatesToEpoch(f)
}
index++;
}
// Convert dictionary to feature set.
return FeatureSet(Text(dict));
... View more
03-08-2023
02:12 PM
|
0
|
0
|
4696
|
|
IDEA
|
Hi @BritaAustin, The Number(myDate) essentially converts it to an EPOCH value. This is only necessary for in the dictionary for constructing the Feature Set. (Checking to see there are any options or plans to change this requirement, as it does trip a lot of people up). In your scenario, I don't think this is the problem -- you aren't creating any date fields in your new feature set. It looks like your looping logic might need some work starting at line 44 (you aren't incrementing the feature index).
... View more
11-30-2022
12:45 PM
|
0
|
0
|
5011
|
|
POST
|
Hi @Curt_H, No near-term plans to update the table element to allow for text wrapping out-of-the box. One other trick you could try is to use hover text (introduced March 2022) to display long strings in tables. Or, there may be some CSS styles you can work with to get the word wrapping you desire within the cell. All the best
... View more
11-28-2022
02:19 PM
|
1
|
0
|
5356
|
|
POST
|
Yep, as you mentioned below, this has been implemented, as shown here All the best
... View more
08-29-2022
05:26 PM
|
1
|
0
|
1880
|
|
POST
|
Hi @CristinaLorenzo-Velazquez, Hope you are well. What is the context of this question? For example, is it x/y data in a pop-up or in a CSV that you are trying to convert? Dave
... View more
05-11-2022
05:04 PM
|
0
|
1
|
612
|
|
IDEA
|
Hi @Amanda__Huber Wondering if you might be able to share the dashboard with me. I played out that scenario and I see the "No data" message in the case when I choose an option from A that has no waterbodies to list in B. In this case, "Celil county" doesn't have any waterbodies, so it shows the "No data" message (which can be renamed).
... View more
04-21-2022
09:44 PM
|
0
|
0
|
1204
|
|
IDEA
|
Hi @Amanda__Huber Sorry to hear about your trouble. If you save and refresh the dashboard, does the "render only when filtered" setting work as expected? Is this the scenario you are after? Dave
... View more
04-14-2022
11:41 AM
|
0
|
0
|
1244
|
|
POST
|
@AMoyers @NeilWebber , the issue should be resolved now. Please try your workflows again.
... View more
03-22-2022
09:59 PM
|
1
|
1
|
5603
|
|
POST
|
Hi @AMoyers @NeilWebber , Thanks for following up. Thank you for your patience and sorry about the confusion about the classification of the issue. We have updated the API to now take the actual geometry into account when doing the spatial filter on a CSV export. So, when you apply a spatial (polygon) filter action to a list of features, then export the source data, you will get the same number of rows in your CSV. This update is planned to roll out with next week's ArcGIS Online release. Please let me know if you have any other questions or concerns with this implementation.
... View more
03-15-2022
05:43 PM
|
0
|
0
|
3635
|
|
POST
|
Hi @MatthewThomas1 , Thanks for the question. The product team will see if there are ways to improve the handling of long strings. Just playing with it for a little bit, I wasn't able to get word wrapping working via Arcade, but I was able to introduce a horizontal scroll that allows you to read longer strings. displayText: `<div style="overflow-x: scroll; ">${$datapoint["LongName"]}</div>`,
... View more
01-24-2022
09:54 AM
|
1
|
5
|
5608
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 06-15-2023 12:25 PM | |
| 1 | 07-24-2019 02:03 PM | |
| 1 | 07-24-2019 01:53 PM | |
| 1 | 07-24-2024 08:54 AM | |
| 1 | 06-15-2023 12:31 PM |
| Online Status |
Offline
|
| Date Last Visited |
a month ago
|