|
POST
|
Hi All, I am joining a feature layer with a feature table which is a repeated table. I think the parameters are correct but when I click on Test button, nothing appears. It doesn't load data. I get GlobalID from the main layer and ParentGlobalID from the feature table. Here is my code: var portal = Portal("https://www.arcgis.com/")
var mainfs = FeatureSetByPortalItem(portal,"365e0c417cd34bfdb06039c76715079e",0,["*"],false)
var tablefs = FeatureSetByPortalItem(portal,"365e0c417cd34bfdb06039c76715079e",1,["*"],false)
var joinedDict = {
fields: [
{ name: "FeatureID", type: "esriFieldTypeGlobalID" },
{ name: "Grant", type: "esriFieldTypeString" },
{ name: "HazardID", type: "esriFieldTypeString" },
{ name: "DTAreaCleared", type: "esriFieldTypeDouble" },
],
'geometryType': '',
'features':[]}
var i = 0;
for (var t in tablefs) {
var tableID = t["ParentGlobalID"]
var filt_mainfs = Filter(mainfs, "GlobalID = @tableID")
for (var p in filt_mainfs){
joinedDict.features[i] = {
attributes: {
FeatureID: tableID,
Grant: p["Grant_Number"],
HazardID: t["Hazard_ID"],
DTAreaCleared: t["DT_Area_Cleared"],
}
}
}
i++
}
//return dictionary
return FeatureSet(Text(joinedDict));
... View more
01-20-2022
02:24 AM
|
0
|
0
|
582
|
|
POST
|
I have four multiple choices that are unique grant numbers and want to combine two by two and give them new names. I have tried but as I am new to Arcade, couldn't manage to do it. Any idea will be appreciated. 15-GR-1060 CWD 20-GR-0040 16-GR-1053 WAD 21-GR-3012 Here is what I have for now, but I want them as two separate categories, CWD and WAD: Here is the expressions: var portal = Portal('https://arcgis.com/');
var EODFAR = GroupBy(
FeatureSetByPortalItem(portal,'49610a8451174e65b413509ff03196b4',0,['*'],false),
['field_1','fatype','field_82'],
[
{ name: 'EODFAR_ID', expression: 'field_2', statistic: 'COUNT' },
],
);
var CWD = filter(EODFAR, "field_82 = '15-GR-1060' and field_82 = '20-GR-0040'");
var WAD = filter(EODFAR, "field_82 = '21-GR-3012' and field_82 = '16-GR-1053'");
var combinedDict = {
fields: [
{ name: 'Choices_WAD_CWD', type: 'esriFieldTypeString' },
{ name: 'Report_date', type: 'esriFieldTypeDate' },
{ name: 'count_of_ids', type: 'esriFieldTypeInteger' },
{ name: 'advisors', type: 'esriFieldTypeString'},
],
geometryType: '',
features: [],
};
// Loop through each of the FeatureSets
var i = 0;
for (var f in EODFAR) {
combinedDict.features[i] = {
attributes: {
Report_date: number(f['field_1']),
advisors: f['fatype'],
count_of_ids: f['EODFAR_ID'],
},
};
i++;
}
// Return dictionary cast as a feature set
return FeatureSet(Text(combinedDict)); @DavidNyenhuis1
... View more
01-07-2022
12:34 PM
|
0
|
1
|
822
|
|
POST
|
Hi @Bryan_Wade That is possible. To go step by step, choose the date selector element, then from Action choose add target and choose any element(indicator, map or any other element which exists within the same dashboard). all the layers you add must have a reference date field and choose that. So you are done! Such as this:
... View more
01-05-2022
11:22 PM
|
0
|
2
|
1487
|
|
POST
|
Using the List Element I am taking multiple layers and out of that, I am going to count the number of reportIDs per Province to know how many monitoring visits were carried out in each province. But looks like it doesn't count properly and the province is not listed uniquely. With my very light knowledge of Arcade I can't figure it out, any help will be appreciated: var portal = Portal('https://www.arcgis.com/');
// Group by province
// Count report IDs
var HMAFAR = GroupBy(
FeatureSetByPortalItem(portal,'56db417ebbc541bcbb6ccf9c49524cc9',0,['*'],false),
['province'],
[
{ name: 'FAR_ID', expression: 'rpt_id', statistic: 'COUNT' },
],
);
var HMAPDIA = GroupBy(
FeatureSetByPortalItem(portal,'cd991db8686d4d0b8c9a6c0e910f03ab',0,['*'],false),
['field_8'],
[
{ name: 'PDIA_ID', expression: 'field_1', statistic: 'COUNT' },
]
);
var MRE = GroupBy(
FeatureSetByPortalItem(portal,'3e63815f693a4d0888209d58ebe7fe8b',0,['*'],false),
['field_8'],
[{ name: 'MRE_ID', expression: 'field_1', statistic: 'COUNT' },
]
);
var NTS = GroupBy(
FeatureSetByPortalItem(portal,'30b595fc7ef64bb596bebcbbffb68db6',0,['*'],false),
['province'],
[
{ name: 'NTS_ID', expression: 'repid', statistic: 'COUNT' },
]
);
var FHMAML = GroupBy(
FeatureSetByPortalItem(portal,'4861c1d8d407434193a012b504b69b36',0,['*'],false),
['field_8'],
[
{ name: 'HMAML_ID', expression: 'field_1', statistic: 'COUNT' },
]
);
var HMAML = filter(FHMAML, "ml_type = 'HMA ML'");
var VA = GroupBy(
FeatureSetByPortalItem(portal,'fbaf2ac4f8bc413c8770f7aaf4e77c4d',0,['*'],false),
['province'],
[
{ name: 'VA_ID', expression: 'rpt_id', statistic: 'COUNT' },
]
);
var layersDict = {
fields: [
{ name: 'Reports_Type', type: 'esriFieldTypeString' },
{ name: 'count_of_ids', type: 'esriFieldTypeInteger' },
{ name: 'provinces', type: 'esriFieldTypeString'},
],
geometryType: '',
features: [],
};
// Loop through each of the six FeatureSets and store attributes into a combined dictionary.
var i = 0;
for (var f in HMAFAR) {
layersDict.features[i] = {
attributes: {
Reports_Type: 'HMAFAR',
count_of_ids: sum(f['FAR_ID']),
provinces: f['province'],
},
};
i++;
}
for (var p in HMAPDIA) {
layersDict.features[i] = {
attributes: {
Reports_Type: 'HMAPDIA',
count_of_ids: sum(p['PDIA_ID']),
provinces: p['field_8'],
},
};
i++;
}
for (var m in MRE) {
layersDict.features[i] = {
attributes: {
Reports_Type: 'MRE',
count_of_ids: sum(m['MRE_ID']),
provinces: m['field_8'],
},
};
i++;
}
for (var n in NTS) {
layersDict.features[i] = {
attributes: {
Reports_Type: 'NTS',
count_of_ids: sum(n['NTS_ID']),
provinces: n['province'],
},
};
i++;
}
for (var ml in HMAML) {
layersDict.features[i] = {
attributes: {
Reports_Type: 'HMAML',
count_of_ids: sum(ml['HMAML_ID']),
provinces: ml['field_8'],
},
};
i++;
}
for (var v in VA) {
layersDict.features[i] = {
attributes: {
Reports_Type: 'VA',
count_of_ids: sum(v['VA_ID']),
provinces: v['province'],
},
};
i++;
}
// Return dictionary
return FeatureSet(Text(layersDict));
... View more
01-04-2022
09:55 PM
|
0
|
2
|
913
|
|
POST
|
@jcarlson , one more question, from the two layers, I want to get a shared field as a long list. For example, I want to have a list of all object IDs from both layers. any idea to edit the expression?
... View more
12-28-2021
12:06 PM
|
0
|
0
|
3877
|
|
POST
|
I want to create an indicator to count items from multiple layers. Is there any arcade expression example or any reference? Any idea will be appreciated.
... View more
12-21-2021
02:19 AM
|
1
|
4
|
3942
|
|
POST
|
Thank you @Anonymous User, I used Linked Content to get data from CSV. Then I have to update the CSV file every week, as this piece of data is very important before filling the Survey form. This process will be tiring in the future to take data from the layer, have it in the CSV and update the previous one. But actually, I wanted to get data in the form of "note" format from the same hosted layer, then display it using a related ID, so the work could be done automatically. Thanks
... View more
12-20-2021
03:05 AM
|
1
|
0
|
2139
|
|
POST
|
Hi @JenAmes You can use this expression instead of the one you have used: if(selected(${represent},'Owner') or selected(${represent},'Owner/Occupant'),${contactname},'') Hope this works, Wali
... View more
12-13-2021
12:26 AM
|
0
|
1
|
1451
|
|
POST
|
Hi @Phil Thank you, that is possible to get data from a field as it shows a list of states or counties. But I need to pull data from a comment field(from the same hosted file) to be displayed as note format, based on the selected ID. Thanks, Wali
... View more
12-12-2021
09:33 PM
|
0
|
2
|
2158
|
|
POST
|
I have an assessment Survey form that collects information about mine-affected communities. I need to display(pull) an answer from the same survey to have insight about an event in the past during data collection. eg, when a SurveyID is selected from the dropdown list, the answer from pre-recorded field to be displayed I understand we can pull data from a CSV file into your form. But I need to load or pull an answer from the same Survey form(hosted feature) to the current form. Is there a solution for this? @IsmaelChivite @Anonymous User
... View more
12-09-2021
08:20 AM
|
0
|
5
|
2223
|
|
POST
|
Hi Keith, Are you going to share the survey with a group? If so, a while ago I had a similar issue. I suggest, in ArcGIS Online, put the feature layer and related files of the form into one specific folder then share the Survey with the group you choose. Hope this works for you. Cheers, Wali
... View more
07-18-2020
12:49 AM
|
0
|
0
|
671
|
|
POST
|
Hi LMCC GIS Admin For this you need to do a trick by going to your profile, then go to My Settings >under section Language, number, and date format section, you can change the date setting as US or UK and the change will affect your Dashboard's Date Selector. Best, Wali
... View more
05-12-2020
01:30 PM
|
0
|
0
|
2719
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 10-21-2023 11:42 AM | |
| 1 | 07-06-2023 01:42 PM | |
| 1 | 07-06-2023 01:51 PM | |
| 1 | 02-17-2023 01:01 PM | |
| 1 | 12-21-2021 02:19 AM |
| Online Status |
Offline
|
| Date Last Visited |
07-16-2025
10:52 AM
|