|
POST
|
You're right, it doesn't work. Honestly, I'm not really sure how the break & continue work. That's the problem with copying other people's code (!). Can you suggest a way to accomplish your original reply?
... View more
02-01-2021
05:16 PM
|
0
|
10
|
9456
|
|
POST
|
Thanks Dave. I tried using break and continue inside the for loop, and it seems to be working. I would like to add my updated expression in a code window, but I don't have that option in a reply. So I've pasted in how I updated the loop: var rating = '' if (cnt > 0) { for(var f in samplesBysite){ //returns ratings for each sample in a list, with date //When(f.MPN_ECOLI < 100, 'Good', f.MPN_ECOLI > 405, 'Poor', 'Fair') + " -- " + Text(f.SAMPLEDATE, 'MMMM Y') + TextFormatting.NewLine //returns one E.coli Rating for the site rating = When(f.MPN_ECOLI < 100, 'Good', f.MPN_ECOLI > 405, 'Poor', 'Fair') if(rating=='Poor') break; if(rating=='Fair') continue} } else { rating = "No samples" } return rating
... View more
02-01-2021
09:34 AM
|
0
|
12
|
9460
|
|
POST
|
I have a hosted Feature Layer (SampleSites) with water quality sampling locations. The sample data is saved in a hosted Table (BacteriaSamples) which has the SITEID field in common. From this table I am looking at the MPN_ECOLI field to designate a "rating" for each sample collected, based on the following criteria: MPN_ECOLI <100 'Good'; > 405 'Poor'; 101-405 'Fair' I have a When function inside a For Loop to create the rating for each sample and have tested that it works by returning a list in my expression (see my code example saved here). But what I really want to do, and cannot figure out, is how to use the ratings created inside the loop as input for additional functions. Ultimately, my goal is to designate an Ecoli Rating for each site, as defined by the lowest quality samples collected at that site. For example, if any samples are rated as 'Poor', the Ecoli Rating for the site is deemed 'Poor'. If no samples are 'Poor', but some are 'Fair', then 'Fair'. Else 'Good'. I tried using Distinct() inside the loop and got nothing. I tried Distinct outside the loop and it returned [Poor], but if it was working it should have returned all three. I know this because the first site that arcade "looks at" inside my expression has 49 bacteria samples, representing Good, Fair, and Poor samples. Interestingly, the last sample in the list is rated as 'Poor'. (Is Distinct somehow looking at my last sample rating only?) Couple other things to note: I've been working on this expression in "configure popup" in ArcGIS Online. The hosted data is in Portal, but when I tried this expression in a web map in Portal, it doesn't work. I'm thinking (hoping) Xander Bakker will have an answer for me 🙂 Thanks! Lynn p.s. ultimately, I want this expression to update the symbology of the sites, but as I understand it, that functionality is not yet available with arcade. /*
store SiteID as a variable so it can be used to query
the BacteriaSamples table for matching records
*/
var siteId = $feature.SITEID
/*
Access Bacteria Samples (related table) as a FeatureSet with three
relevant fields and filtered on QA/QC status
*/
var samplesAll = Filter(FeatureSetById($map, /* Watershed - BacteriaSamples */ "Watershed_962", ['SAMPLEDATE', 'SITEID','MPN_ECOLI']), "QAQC_COMPL = 'yes'")
/*
Use SQL filter statement to access variable with "@";
essentially this creates a relate
*/
var filterStatement = "SITEID = @siteId"
//filter the table to find related records at each site
var samplesBysite = Filter(samplesAll, filterStatement)
//Store count of resulting records as a variable
var cnt = Count(samplesBysite)
Console("Number of Samples: " + cnt)
/*
loop thru the records to calculate a rating for each
sample based on following criteria:
MPN_ECOLI<100=Good; >405=Poor; 101-405=Fair
*/
var rating = ''
if (cnt > 0) {
for(var f in samplesBysite){
//returns a list of each sample rating
rating += When(f.MPN_ECOLI < 100, 'Good', f.MPN_ECOLI > 405, 'Poor', 'Fair') + TextFormatting.NewLine
}
return (rating)
} else {
rating = "No sample data"
}
/*
Next, determine final ecoliRating for the site. If any sample rating is 'Poor', the final ecoliRating for the site is 'Poor'. If no samples are 'Poor' but some are 'Fair', then 'Fair'. Else 'Good'. Help!!!
*/
... View more
01-29-2021
01:57 PM
|
0
|
15
|
12446
|
|
POST
|
Turns out, my problem was I logged in to the UC landing page with my Esri login, but hadn't actually logged in to the event itself (whoops). I noticed that the website was updated later in the day to make it more obvious.
... View more
07-14-2020
09:09 AM
|
2
|
1
|
3386
|
|
POST
|
I cannot figure out how to work the agenda! Is it just me? I'm logged in and things that are happening currently (the first expo is live now, or Jack's plenary earlier) are not accessible from the agenda or the schedule. As in, there is no clickable link. I did just notice the "add to agenda" option in the schedule, so I added the first expo to my agenda (clicked the star and now it is in "My Favorites"), but I still can't figure out how to "get in". Help!
... View more
07-13-2020
12:34 PM
|
1
|
7
|
3614
|
|
BLOG
|
I am trying to make this work, but I cannot get my selection boxes to be clickable. As far as I can tell, I'm following all the steps properly...having carefully reviewed this post as well as the comments here: Using image-map in Survey123 Connect. At first I thought it was the viewport vs. viewbox. I'm using Illustratror and when I save as an SVG, the XML has a viewBox identified in the code but not a viewport. But, when I added in the width and height, my paths were still not clickable. Then I tried deleting the embedded image code from the XML and voila...I get my clickable boxes! So, there's something funky about my image?? It's a placed JPG in the Illustrator file, and I selected the option to embed the image when I saved the SVG. **Note: the image group in the XML is a huge block of gibberishy looking code. Is that normal? If you want to have a look, my survey is saved here. Please help! Thanks, Lynn
... View more
02-27-2020
11:45 AM
|
0
|
0
|
24387
|
|
POST
|
No, I hadn't made any edits in quite awhile to that dashboard. It's been working like a charm for months. I just happened to notice that nothing was "working" on the dashboard last week.. I must have had at least 20 actions configured for the various widgets. Will have to reconfigure all.
... View more
02-04-2020
09:26 AM
|
0
|
1
|
953
|
|
POST
|
I have three Operations Dashboards (in agol) that reference the same feature service (in portal). I noticed today that all of the "Actions" that I added to one of the dashboards are just simply gone. All Actions in the other two dashboards still work. So now I'll have to manually reconfigure all of the actions in each of the widgets (ugh). What the heck happened??
... View more
01-28-2020
03:58 PM
|
0
|
3
|
1062
|
|
POST
|
Hi James, To answer your question....yes, we opened the survey from the Sent box. We didn't actually make any edits, just tried to resend. Prior to that, we had not removed anything from the database. Those 4 sample records (the first 4 out of the 11 collected in the repeat) were still in the SDE. We have since copied and resubmitted the entire survey as a new survey (sans emojis!) and all 11 samples went through successfully. What exactly happened here? I would very much like to avoid this problem in the future. We could have easily missed the fact that some of the samples were missing in the SDE. And, if the sent survey had been cleared from the ipad, there would be no way to recreate and resubmit the data. Also, would Jordan Miller suggestion to add the {query allowUpdates=true allowAdds=true} parameter to the repeat have prevented this problem? Thanks, Lynn
... View more
07-16-2019
09:16 AM
|
0
|
1
|
1849
|
|
POST
|
Makes sense. Thanks. Can you help us figure out why only 4 of the 11 records in the repeat were saved in the database. Was it the emojis in the notes field?
... View more
07-15-2019
11:45 AM
|
0
|
1
|
1849
|
|
POST
|
We tried deleting the gibberish text in the Sample Notes field and then resending the survey. Now it's stuck in the outbox and we got the following send error:
... View more
07-15-2019
09:48 AM
|
0
|
16
|
1849
|
|
POST
|
When I reopen the survey from the Sent Box (on ipad, v 3.5.164), I can see all 11 sample records in the repeat. But, only the first 4 samples collected actually made it through to the related table in SDE. I have only one potential clue, but it's probably a long shot. The "Sample Notes" field in the 5th record contains gibberish (butt dial maybe??). Could that have somehow prevented this record, and the following 6, from being sent through to the database? I haven't yet tried to resend the survey. What happened??? Thx, Lynn
... View more
07-12-2019
04:20 PM
|
2
|
17
|
3372
|
|
POST
|
Thanks Doug. Okay, I made a couple other changes (using NaN since this is an integer field): if(. != NaN, (. >= 0 and . <= 49), 1) Didn't work. James Tedrick is there something I'm missing?
... View more
07-09-2019
11:37 AM
|
0
|
2
|
1977
|
|
POST
|
Thanks Doug, I can try adding an if statement to my constraint. Constraints: ColiformLarge: . >= 0 and . <= 49 ColiformSmall: . >= 0 and . <= 48 EcoliLarge: . >= 0 and . <= 49 EcoliSmall: . >= 0 and . <= 48 Although I'm not entirely sure how to achieve your suggested: "if value1 is not blank then check constraint otherwise do nothing". I tried the following, but they didn't work: if(${ColiformLarge} != '', (. >= 0 and . <= 49),'') if(${ColiformSmall} != '', (. >= 0 and . <= 48),'') if(${EcoliLarge} != '', (. >= 0 and . <= 49),'') if(${EcoliSmall} != '', (. >= 0 and . <= 48),'') Also, it's strange how the form got hung up on the second field with a constraint. Why not the first? Or all four?
... View more
07-09-2019
10:30 AM
|
0
|
4
|
1977
|
|
POST
|
Woohoo, it worked! That'll teach me to copy/paste from a blog post. When I test the expression i get: arcgis-trek2there://?stop=-12456784.157737207,-12456784.157737207 But I'm not really sure what to do next. I've added the above link to the custom attributes in my popup, and it launches the Trek2There app, but T2T says "no destination set". Is this related to the WGS 1984 issue?
... View more
07-05-2019
04:13 PM
|
0
|
2
|
1423
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 10-01-2021 01:34 PM | |
| 1 | 05-03-2023 12:56 PM | |
| 1 | 03-10-2023 11:06 AM | |
| 5 | 05-05-2022 04:20 PM | |
| 1 | 06-05-2018 11:08 AM |
| Online Status |
Offline
|
| Date Last Visited |
04-10-2025
04:49 PM
|