|
DOC
|
Hi Josh, Glad you find the script useful! The names of the files are set on lines 117: fileName = '{}-{}'.format(attachmentId, attachmentName) and 131 (depending on whether you are using individual or grouped folders): fileName = '{}-{}-{}'.format(currentObjectId, attachmentId, attachmentName) However in order to include attribution in the file name the code would need a decent amount of rejigging. The reason for this is that only Object ID's are returned from the Feature Layer as in link 92. A subsequent query would need to be made to get the attribution. featureObjectIds = featureLayer.query(where='1=1', return_ids_only=True) The reason it's written this way is to ensure the script can deal with a large dataset. It's a good suggestion so I'll consider enhancing the script if I get a chance. But it's unlikely to happen anytime soon. Please feel free to contribute to the script in GitHub if you manage to figure it out! Mikie
... View more
11-15-2017
01:05 AM
|
1
|
0
|
30209
|
|
POST
|
Just to add to that, there are ways to limit access to public layers. See this link for further details - it enables you to lock down what referrers the data can be accessed from. If you were to do this, you would build a survey on top of the existing Feature Service.
... View more
11-14-2017
06:54 AM
|
1
|
0
|
1908
|
|
BLOG
|
Hi Joel, I don't believe pulldata() is currently implemented as part of the web forms just yet. So this will only work through the Survey123 app. Michael
... View more
11-06-2017
09:40 AM
|
0
|
0
|
24860
|
|
POST
|
Hi Eric, Are you sure the cases for the field names match the service endpoint? iOS can sometimes be more sensitive when it comes to cases. If this isn't the problem, can you show us what the URL looks like through the webmap? I wouldn't expect the field to be populated like that either way.
... View more
11-06-2017
07:23 AM
|
0
|
1
|
1548
|
|
POST
|
Hi Siew, That's great to hear. There is indeed a way to prevent field attributes being created - see https://community.esri.com/groups/survey123/blog/2017/10/26/the-power-of-nothing?sr=search&searchId=4156b067-ee4f-49f6-8618-f01e110f2bd5&searchIndex=0 blog post for further details. All you have to do is specify the value of the bind::esri:fieldType column as null for the fields in question. Michael
... View more
11-06-2017
02:29 AM
|
0
|
1
|
3134
|
|
POST
|
Hi Siew, I think what you need is the substr() function. The substr operator will return only part of a string, defined by the numbers after it. The first character determines the starting point of the selection, while the second value determines the length (if no second value is present, it will continue until the end of the string). In your case, you can use something like this in the calculation column: substr(${AssetId}, 0, 2) substr(${AssetId}, 2, 5) substr(${AssetId}, 5, 😎 Bear in mind that the format must be consistent xxyyyzzz. I don't think passing this into a cascading select as a default answer is supported.
... View more
11-03-2017
02:47 AM
|
2
|
3
|
3134
|
|
POST
|
Hi Tony. This is currently an open issue, but I believe it is being addressed in the next release (2.5). You can participate in the Early Adopter Program if you want to test it out. The only workaround that I am aware of is to make the field you want to make read-only a hidden field, and then calculate it into a note field.
... View more
11-02-2017
09:59 AM
|
0
|
1
|
2321
|
|
BLOG
|
Hi Linda. Pulldata is only supported with 1-1 relationships. So if there is more than one column with the same value, it will only return the first one found.
... View more
11-02-2017
09:43 AM
|
0
|
0
|
49501
|
|
BLOG
|
Hi Victoria. No, this is not currently supported. But you can replicate the field names of the select_one drop down list in the csv and pull data from it based on a select_one selection.
... View more
11-02-2017
09:37 AM
|
0
|
0
|
49501
|
|
IDEA
|
This is at least partially possible through Survey123 at the 2.4 release. See The Power of Nothing blog post for further details. The enables you to capture more than one point through attributes using the pulldata(‘@geopoint’) function in combination with the null bind::esri:fieldType. The alternative is to have repeat sections with a restriction of one answer per repeat with geopoint questions. The points are then stored in separate layers, so you can display them on a map without post processing (as they are not just attributes).
... View more
11-01-2017
02:03 AM
|
2
|
1
|
3136
|
|
IDEA
|
This is at least partially possible through Survey123 at the 2.4 release. See The Power of Nothing blog post for further details. The enables you to capture more than one point through attributes using the pulldata(‘@geopoint’) function in combination with the null bind::esri:fieldType. The alternative is to have repeat sections with a restriction of one answer per repeat with geopoint questions. The points are then stored in separate layers, so you can display them on a map without post processing (as they are not just attributes).
... View more
11-01-2017
02:03 AM
|
2
|
1
|
2758
|
|
POST
|
Nice job Rich - really handy. I've made a slight variation (mainly simplified) to cater for what we want. Instead of deleting the user, we just change the password. And we disable the user when the course is finished. We also have a role which means students can't create groups so deleting these is not necessary. Deletes any content created by students Deletes any folders created by students Disables student accounts Verifies the correct role is applied to the user Changes password DeleteUserContent = True
DeleteUserFolders = True
DisableAccount = True
VerifyRole = True
RoleId = 'WlnpXFdbXk9EktYp'
ChangeUserPassword = True
OldPassword = 'MyOldPassword'
NewPassword = 'MyNewPassword'
PortalUsername = 'MyUsername'
PortalPassword = 'MyPassword'
Users = ['StudentUsernameOne', 'StudentUsernameTwo']
from arcgis.gis import GIS
from IPython.display import display, HTML
gis = GIS('https://www.arcgis.com', PortalUsername, PortalPassword)
for User in Users:
display(HTML('<h1>User: {}</h1>'.format(User)))
UserObject = gis.users.get('{}'.format(User))
#DELETE USER CONTENT ITEMS
if DeleteUserContent == True:
display(HTML('<h3>Deleting User Content Items...</h3>'))
Items = gis.content.search(query='owner:{}'.format(User), max_items=99999)
print('{} Item(s) Returned'.format(len(Items)))
try:
for Item in Items:
print('Deleting Item: {} - {} - {}'.format(str(Item['owner']), str(Item['title']), str(Item['type'])))
display(Item)
Item.protect(enable = False)
Item.delete()
except:
pass
else:
display(HTML('<h3>DeleteUserContent not set to True</h3>'))
#DELETE USER FOLDERS
if DeleteUserFolders == True:
display(HTML('<h3>Deleting User Folders...</h3>'))
Folders = UserObject.folders
print('{} Folder(s) Returned'.format(len(Folders)))
try:
for Folder in Folders:
FolderDeletedResult = gis.content.delete_folder(Folder['title'], owner=User)
print('Folder "{}" Deleted: {}'.format(Folder['title'], FolderDeletedResult))
except:
pass
else:
display(HTML('<h3>DeleteUserFolders not set to True</h3>'))
#DISABLE ACCOUNT
if DisableAccount == True:
display(HTML('<h3>Account being disabled</h3>'))
DisableAccountResult = UserObject.disable()
print('Account Disabled: {}'.format(DisableAccountResult))
else:
display(HTML('<h3>DisableAccount not set to True - Ensuring account is not disabled</h3>'))
DisableAccountResult = UserObject.enable()
print('Account Enabled: {}'.format(DisableAccountResult))
#VERIFY ROLE
if VerifyRole == True:
display(HTML('<h3>Role being Verified</h3>'))
UpdateRoleResult = UserObject.update_role(role = RoleId)
print('Specified Role Applied: {}'.format(UpdateRoleResult))
else:
display(HTML('<h3>VerifyRole not set to True</h3>'))
#CHANGE PASSWORD
if ChangeUserPassword == True:
display(HTML('<h3>Password being changed</h3>'))
ChangeUserPasswordResult = UserObject.reset(OldPassword, new_password = NewPassword)
print('Password Changed: {}'.format(ChangeUserPasswordResult))
else:
display(HTML('<h3>ChangeUserPassword not set to True</h3>'))
... View more
10-31-2017
05:49 AM
|
2
|
0
|
2720
|
|
POST
|
It is indeed - all the documentation including downloads links, etc. can be found here. The source code is also available on GitHub.
... View more
10-31-2017
01:59 AM
|
1
|
0
|
910
|
|
BLOG
|
On occasion, you may want to limit the extent in which points can be input into a survey. This may be to simply validate the input data on initial entry, or to restrict input for functional requirements. In the attached survey, the extent has been limited to Ireland. In order to do this, there are a few things that have to be done. 1. Get Extent Values A good way to do this is to go to your organisations settings. Go to your Organisation - Edit Settings - Map and click Choose Extent as below. From there, you can a Draw an extent, and note down the Lat/Long values you will need to use in your survey. The values below correspond to the values used in the attached form, so you can directly replace them as necessary. The alternative is to use the super-useful Super-Duper Extent Helper developed by Bradley Snider. 2. Setup Calculations in Survey123 Connect There are various calculations you have to make in order to limit and input point to a particular extent, as below. pulldata("@geopoint",${Location},"x") This pulls the x attribute from the ${Location} geopoint question and stores it as a separate attribute Further information on pulling data from geopoint questions can be found in this blog post pulldata("@geopoint",${Location},"y") This pulls the y attribute from the ${Location} geopoint question and stores it as a separate attribute if((number(${XValue}) > -10.7) and (number(${XValue}) < -5.4), 1, 0) This uses the if function in order to ensure the the x attribute returned from the pulldata function is between -10.7 and -5.4. If this is true, the value of this field is equal to 1, otherwise it is equal to 0 if((number(${YValue}) > 51.4) and (number(${YValue}) < 55.4), 1, 0) This uses the if function in order to ensure the the y attribute returned from the pulldata function is between 51.4 and 55.4. If this is true, the value of this field is equal to 1, otherwise it is equal to 0 int(${ValidX}) + int(${ValidY}) This calculation adds the values of both if calculations together 3. Setup Constraint This is ultimately what is used to check whether the point is within the specified extent. A message is returned to the user if it is not within the appropriate extent. In order for this to pass, it's value must equal 2 (i.e. the sum of both if statements). If it is not equal to 2, it means that either the x or y attributes, or both do not lie within the specified extent. 4. Hide and Don't Store Validation Calculations In order to hide any validation calculations, we set the field types as hidden. We also use The Power of Nothing to ensure fields are not created to store the calculation results being used as part of the point validation (see bind::esri:fieldType column). 5. Add a Note when Outside of Extent This will help notify the user that they are outside of the allowable extent. To do this, you add a note row, along with a label - not including a name here results in a field not being created in the Feature Layer for the note. Then specify a relevant calculation so that the warning message only gets displayed when the user is outside of the allowable extent. See the completed form below (also attached): type name label constraint constraint_message relevant calculation bind::esri:fieldType geopoint Location Specify Location hidden XValue X Co-Ordinate pulldata("@geopoint",${Location},"x") null hidden YValue Y Co-Ordinate pulldata("@geopoint",${Location},"y") null hidden ValidX X Within Range if((number(${XValue}) > -10.7) and (number(${XValue}) < -5.4), 1, 0) null hidden ValidY Y Within Range if((number(${YValue}) > 51.4) and (number(${YValue}) < 55.4), 1, 0) null hidden Allowed Within Specified Extent? .=2 Specified Location Outside of Extent int(${ValidX}) + int(${ValidY}) null note <b><center><font color="red">**** Specified Location Outside of Ireland ****</font></center></b> ${Allowed} != 2 This is not currently supported in Web Forms because the pulldata() function is not supported when used against geopoint question (as documented here)
... View more
10-26-2017
08:14 AM
|
8
|
10
|
11503
|
|
BLOG
|
Hi Yaser - glad you like the blog! In answer to your questions: You would have to add a Global ID to the parent feature class, output the feature class as a table and remove duplicate Parent ID's. Then join this to the child table so you have access to the appropriate Parent ID (new Guid) and copy this into a new Guid field associated with the Child record. Then remove the old relationship and add the new relationship. Note I have not done this, but I think this workflow will work. *First create a copy of the geodatabase so you have a backup.* You can filter the child records from the webmap, and base Dashboard values on these. With 1-1 relationships, you can add relevant attributes to a popup. With 1-m relationships, you can add statistics of numeric values (sum, min, max) to a popup.
... View more
09-25-2017
02:46 AM
|
1
|
0
|
11211
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 03-06-2018 07:35 AM | |
| 1 | 05-27-2017 02:06 PM | |
| 1 | 05-29-2017 07:36 AM | |
| 1 | 05-19-2017 08:54 AM | |
| 1 | 05-23-2017 12:43 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:22 AM
|