POST
|
You can always test and see: When you need another module, you can always include a cell at the top of your notebook to install it first. A small module like this installs pretty quick, so it shouldn't slow down your process too much. !pip install xlwt
... View more
08-11-2022
10:08 AM
|
0
|
1
|
471
|
POST
|
Just to follow up, I wanted to let you know that this is definitely going to work for us. Coalescing the choices into a single field for each question is tedious to set up, but only has to happen once. The field crews, however, will see something familiar and orderly. Thank you again!
... View more
08-11-2022
08:13 AM
|
0
|
1
|
448
|
POST
|
By assigning a value to a key, Arcade will overwrite an existing value or create a new key if it doesn't already exist. var f = Dictionary('field1', 1, 'field2', 2)
// add new key/value pair
f['field3'] = 'hey'
// overwrite existing value
f['field1'] = 'overwrite!'
return f PS - I'm assuming that's just a made-up sample, but don't use existing function names like first as variable names, it's just asking for trouble!
... View more
08-11-2022
06:54 AM
|
2
|
1
|
1551
|
POST
|
If you're using the developer edition, everything should be in /server/public/apps/your-app-id in the ExperienceBuilder folder. I don't have experience implementing custom widgets, however.
... View more
08-11-2022
06:51 AM
|
0
|
1
|
746
|
POST
|
That sounds like a bug, to be honest. Normally a simple field calculation like that is near-instantaneous in Pro for me.
... View more
08-11-2022
06:47 AM
|
0
|
0
|
917
|
POST
|
That is clever. I should be able to get a lot closer to the paper form's look and feel with this. Thanks for sharing the xls form!
... View more
08-11-2022
06:26 AM
|
0
|
0
|
451
|
POST
|
Well, it depends on what you're doing with the script. You can authenticate with the API using a named user, and the script would then have access to anything that user does. So an anonymous user could access any public layers and apps, but be unable to change anything, whereas an admin would be able to access and edit anything.
... View more
08-10-2022
02:23 PM
|
0
|
1
|
675
|
IDEA
|
@COSPNWGuy Sounds like an org-level setting. Looks like .ipynb files aren't supported, at least here in the Ideas comments. Here's the code, minus all the nice markdown cells that explain things. from arcgis.gis import GIS
import pandas as pd
gis = GIS("home")
find_id = input('ItemID: ')
find_url = gis.content.get(find_id).url if find_id else input('Service URL: ')
print(find_url)
webmaps = gis.content.search('', item_type='Web Map', max_items=-1)
map_list = [m for m in webmaps if str(m.get_data()).find(find_url) > -1]
apptypes = ['Application', 'Dashboard', 'Story Map', 'Web Experience']
webapps = [item for sublist in [gis.content.search('', item_type=t, max_items=-1) for t in apptypes] for item in sublist]
app_list = []
for w in webapps:
try:
wdata = str(w.get_data())
criteria = [
wdata.find(find_url) > -1,
wdata.find(find_id) > -1,
any([wdata.find(m.id) > -1 for m in map_list])
]
if any(criteria):
app_list.append(w)
# Some apps don't have data, so we'll just skip them if they throw a TypeError
except:
continue
dependencies = pd.concat(
[
pd.DataFrame([{'title':a.title, 'id':a.id, 'type':a.type, 'url':f'{gis.url}/home/item.html?id={a.id}'} for a in app_list]),
pd.DataFrame([{'title':m.title, 'id':m.id, 'type':m.type, 'url':f'{gis.url}/home/item.html?id={m.id}'} for m in map_list])
]
)
# do something with the dependencies dataframe
... View more
08-10-2022
01:16 PM
|
0
|
0
|
2042
|
POST
|
You've still got a handful of s variables in the expression you posted.
... View more
08-10-2022
07:58 AM
|
0
|
0
|
1567
|
POST
|
So, just to be clear: the fields don't currently exist on the polygon layer? If that's the case, you may as well do a spatial join. Either do the GP tool and save the new output, or else do the right-click spatial join and save the result to a new layer. In terms of automation, there are ways to copy portions of one layer's schema to another, but that really only needs to be done once. If your layers are in a geodatabase and you can take advantage of Attribute Rules, the same expressions posted earlier for calculating fields could be used to populate a polygon's attributes automatically if it were drawn around an existing point.
... View more
08-10-2022
06:41 AM
|
0
|
0
|
451
|
POST
|
How are you handling line breaks in your popup expression? It looks like that's probably the cause, somehow WAB is ignoring your line breaks.
... View more
08-10-2022
05:54 AM
|
0
|
0
|
649
|
POST
|
PS - Since I was using sample data, I accessed the features with a made-up variable s. Just replace those with $feature to apply this to your own situation.
... View more
08-10-2022
05:52 AM
|
0
|
0
|
1578
|
POST
|
I tried accomplishing this with some sample data, and here's what worked for me: // check for section header first
if (IsEmpty(s['Section'])){
return `\n${s['StreetNames']}\n`
} else {
// build string
var text_len = Count(s['StreetNames']) + Count(s['Section'])
Console('total text length ', text_len)
// get number of remaining spaces between text
var spaces = 30 - text_len
var dot_string = ' '
// leaving at least two characters for spaces on either end, populate the rest of the dot string
for (var x=0; x < spaces-2; x++){
// add '.' for even-numbered iterations, ' ' for odd-numbered
dot_string += Iif(x % 2 == 0, '.', ' ')
}
dot_string += ' '
// add full string to output
return `${s['StreetNames']}${dot_string}${s['Section']}\n`
} A few pointers: I like to use template literals for building strings. Instead of $feature.attribute1 + ', ' + $feature.attribute2 + TextFormatting.NewLine, you could have `${feature.attribute1}, ${feature.attribute2}\n`. For building the dot string, I did things a bit differently with the for loop. Rather than iterate over once for every two characters in the remaining space, it would take the left over characters (30 - street name and sections) and alternate between '.' and ' ', leaving room on both ends for a space. It seems to work well enough, though the dots don't always align vertically from row to row. You could further modify this to get those dots to align nicely, but here's what my expression produces.
... View more
08-10-2022
05:51 AM
|
1
|
1
|
1579
|
POST
|
I'm doing some testing for our Health Department, to see if Survey123 can meet their needs for going digital with their Food Inspections program. As part of their inspections, there are multiple series of questions organized in groups. Within a single series, the paper form is laid out much like the table-list appearance type. However, not all the questions within the series can have all the options, but the remaining options will be the same. Is there any way to accomplish a compact form like a table list in which users see the available choices in the same positions, but in which the choices available can change? Simply using two or more choice lists in S123 causes errors. Here's a mock-up: What I'd like to get I've tried using choice filters, which do effectively limit the choices available, but the positions are not held. The closest I can actually come Am I just out of luck here? Edit to add: I have considered rearranging the questions into sub-groups, such that all questions with the choice combinations are in groups together, but this won't work. The order of questions on the inspection form was very deliberately chosen, so I can't change them like that. I need them to show up in the proper order, and have been asked to align the choices into the same columns regardless of what choices are available on a given question.
... View more
08-09-2022
09:32 AM
|
0
|
4
|
488
|
IDEA
|
Hmmm. I thought I shared it publicly, I'm sorry. Try again?
... View more
08-09-2022
07:26 AM
|
0
|
0
|
2090
|
Title | Kudos | Posted |
---|---|---|
1 | yesterday | |
1 | 03-14-2022 08:31 PM | |
1 | yesterday | |
1 | 03-05-2024 09:51 AM | |
1 | 12-01-2023 02:25 PM |
Online Status |
Offline
|
Date Last Visited |
18 hours ago
|