|
POST
|
The current documentation shows a simpler import import 'path/to/style.css';
... View more
04-25-2025
11:45 AM
|
0
|
1
|
1580
|
|
POST
|
To get the latest inspection for all of the hydrants, this code should work. Make sure you change the name of 'HyrantID' to the correct field name var inspections = FeatureSetByPortalItem(
Portal("https://maps.casselberry.org/portal"),
"f3a4a8879ce34241a5fd139ddfaf727a", // Inspection Layer Item ID
0
);
GroupBy(inspections , 'HyrantID', {name: 'Latest', expression: 'dateinspected', statistic: 'MAX'})
... View more
04-23-2025
10:27 AM
|
2
|
4
|
2842
|
|
POST
|
Are you using an older version of Enterprise? If so, you'll have to use return FeatureSet(Text(dict)); And yes, this code only returns the most recent inspection.
... View more
04-23-2025
10:10 AM
|
0
|
0
|
2842
|
|
POST
|
Ah, I forgot the first rule of Data Expressions...always return a FeatureSet. This should work var inspections = FeatureSetByPortalItem(
Portal("https://maps.casselberry.org/portal"),
"f3a4a8879ce34241a5fd139ddfaf727a", // Inspection Layer Item ID
0
);
var feat = First(OrderBy(inspections, "dateinspected DESC"));
var dict = { fields: Schema(inspections ).fields, features: [feat] };
return FeatureSet(dict);
... View more
04-23-2025
09:39 AM
|
1
|
7
|
2876
|
|
POST
|
The dataset in the Github repository example has that date in a text field, not a date field. If your field is a date field, you can do this much easier using the OrderBy and First functions var inspections = FeatureSetByPortalItem(
Portal("https://maps.casselberry.org/portal"),
"f3a4a8879ce34241a5fd139ddfaf727a", // Inspection Layer Item ID
0
);
return First(OrderBy(inspections, "dateinspected DESC"));
... View more
04-23-2025
09:23 AM
|
1
|
9
|
2879
|
|
POST
|
Unfortunately, that didn't work either. The ItemSelector would now add items as I scrolled down, but the div was still too long for the SidePopper. However, it was close. This is what finally worked for me <SidePopper
position="right"
title="Template Layer"
isOpen={showSidePopper && !urlUtils.getAppIdPageIdFromUrl().pageId}
toggle={onCloseSidePopper}
trigger={sidePopperTrigger?.current}
>
<div className="d-flex flex-column h-100">
<div className="data-item-search flex-grow-1 h-75">
<ItemSelector
itemType={SupportedItemTypes.FeatureService}
portalUrl={portal.url}
mode={ItemSelectorMode.Simple}
onSelect={onItemSelect}
onRemove={onItemRemove}
selectedItems={selectedItems}
></ItemSelector>
</div>
<div className="d-flex justify-content-center mb-2">
<Button
variant="contained"
color="primary"
onClick={onDoneClicked}
disabled={selectedTemplateItem == null}
>
Done
</Button>
</div>
</div>
</SidePopper>
... View more
04-23-2025
09:01 AM
|
0
|
0
|
834
|
|
POST
|
I'm using the ItemSelector in my custom widget (v1.17), but I'm having difficulty getting it to work correctly. I want to have the simple list in a SidePopper along with a button to accept the choice. This code <SidePopper
position="right"
title="Template Layer"
isOpen={showSidePopper && !urlUtils.getAppIdPageIdFromUrl().pageId}
toggle={onCloseSidePopper}
trigger={sidePopperTrigger?.current}
>
<div className="d-flex flex-column">
<div className='data-item-search'>
<ItemSelector
itemType={SupportedItemTypes.FeatureService}
portalUrl={portal.url}
mode={ItemSelectorMode.Simple}
onSelect={onItemSelect}
onRemove={onItemRemove}
selectedItems={selectedItems}
></ItemSelector>
</div>
</div className="d-flex justify-content-center">
<Button
variant='contained'
color='primary'
onClick={onDoneClicked}
disabled={selectedTemplateItem == null}
>
Done
</Button>
</div>
</SidePopper> will give me a list of 18 items. The list doesn't add more items as I scroll down and regardless of what I put in the Search box, I get a maximum of 18 entries. I've tried a variety of classNames, but nothing seems to work. Only if I add an explicit height in pixels (percentage doesn't work either) will I get a list that adds more items as I scroll down. <div className="data-item-search" style={{ height: '500px' }}>
<ItemSelector
itemType={SupportedItemTypes.FeatureService}
portalUrl={portal.url}
mode={ItemSelectorMode.Simple}
onSelect={onItemSelect}
onRemove={onItemRemove}
selectedItems={selectedItems}
></ItemSelector>
</div> Obviously, this isn't responsive. What's the proper way to style this component and the button to make it fill the SidePopper?
... View more
04-22-2025
12:36 PM
|
0
|
2
|
903
|
|
POST
|
You'll have to do the same thing with any field that a text function (split, startswith, replace, etc). Since most of the conditional lines are testing [ADMIN_ORG], you should put that at the beginning, like this: def FindLabel ( [TRAIL_NO], [ADMIN_ORG], [MANAGING_ORG], [TRAIL_NAME],[NATIONAL_TRAIL_DESIGNATION]):
if [ADMIN_ORG]:
if [ADMIN_ORG].startswith('02'):
// You can put that on one line, like this: elif [MANAGING_ORG] and [MANAGING_ORG].startswith('031204'):
... View more
04-22-2025
11:09 AM
|
0
|
0
|
1749
|
|
POST
|
If a record contain a null value in [TRAIL_NO], then you'll get the split error. You have to check whether that attribute is not null before attempting to split it (line 7). def FindLabel ( [TRAIL_NO], [ADMIN_ORG], [MANAGING_ORG], [TRAIL_NAME], [NATIONAL_TRAIL_DESIGNATION] ):
if [ADMIN_ORG].startswith('02'):
s='.'
if [ADMIN_ORG].startswith('0201'):
return [TRAIL_NO] [2:]
else:
if [TRAIL_NO]:
return [TRAIL_NO].split(s,1)[0]
else:
return "TRAIL_NO is null"
... View more
04-22-2025
07:30 AM
|
0
|
2
|
1769
|
|
POST
|
It's difficult to follow the logic of this code. When posting code (especially Python code, where indenting is important), please use the "Insert/Edit code sample" button.
... View more
04-21-2025
06:38 AM
|
1
|
2
|
1817
|
|
POST
|
You can have multiple LIKES, but you have to use "OR" not "||" FaunaPResent_MarshQuad LIKE '%1%' OR FaunaPresent_MarshQuad LIKE '%2%'
... View more
04-18-2025
10:30 AM
|
0
|
1
|
1768
|
|
POST
|
Instead of deleting the question, can you post how you solved this? That might help others who have the same problem
... View more
04-18-2025
05:59 AM
|
0
|
1
|
1227
|
|
POST
|
Did you change the name of the date field in line 9? return Filter(fs, `EXTRACT(YEAR from yourDateField) = ${Year(Now())}`)
... View more
04-15-2025
06:22 AM
|
0
|
0
|
2094
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 02-04-2025 06:39 AM | |
| 1 | 05-01-2026 08:26 AM | |
| 1 | 04-10-2026 12:01 PM | |
| 1 | 04-13-2026 09:11 AM | |
| 1 | 10-11-2023 06:18 AM |
| Online Status |
Offline
|
| Date Last Visited |
3 weeks ago
|