POST
|
I'm trying to overwrite a published service on a federated server. I've been following the ESRI sample script here: https://github.com/jnshill/ArcPyPublishing/blob/8af7523a692498e4c22a142dfc940e3c355efaba/PublishLayersAsMIL_FA_Timezone.py#L95 without much success. Despite assigning the federatedServerURL, I get a "Missing target server" error. I've confirmed that the token I pull from the Portal works by singing into the REST API. I verified the federated server URL by logging into the Portal Administrator Directory -> Federation -> Servers and snagging the URL field from there. However, even with all of that....still missing target server. In the python code, I can call the .federatedServerURL and it will yield a result that matches with what is in my administrator directory. Anyone have any ideas on what else to check? outdir = r'D:\\location'
## Folder the Map Service will Go too
in_folder="Folder1"
service = "servicename"
sddraft_filename = service + ".sddraft"
sddraft_output_filename = os.path.join(outdir, sddraft_filename)
# Reference map to publish
aprx = arcpy.mp.ArcGISProject(r"C:\\Project.aprx")
# Get first map
m = aprx.listMaps("MapName")[0]
# List enterprise URl and credentials here
portalURL = r"https://portalServer/webAdaptor"
fed_server = r"https://ServerURL/webAdaptor"
cred_detail = []
#sign into credentials
portal_pw = keyring.get_password("stuff", "user")
portal_user = "user"
#Sign into Portal
arcpy.SignInToPortal(portalURL, portal_user, portal_pw)
# Create MapImageSharingDraft and set service properties
sharing_draft = m.getWebLayerSharingDraft("FEDERATED_SERVER", "MAP_IMAGE", service)
sharing_draft.federatedServerURL = fed_server
sharing_draft.portalFolder = 'Folder1'
sharing_draft.description = "Description"
sharing_draft.credits = "Name"
sharing_draft.tags = "Tags"
sharing_draft.copyDataToServer = False
sharing_draft.overwriteExistingService = True
sharing_draft.exportToSDDraft(sddraft_output_filename)
... View more
07-03-2023
07:53 AM
|
0
|
2
|
634
|
POST
|
The result ended up being that the relationship name as it was in Pro changes when published into Portal so the expression had to be modified to reflect that within Portal side.
... View more
07-03-2023
07:45 AM
|
0
|
0
|
620
|
POST
|
I have an arcade expression that pulls data from a relationship into the associated feature class's popup. It loops through multiple associated records and outputs all found ones for that feature class. In Pro, it outputs correctly to the popup. However, in Portal,I get an error: Execution Error:Filter cannot accept this parameter type. I'm not quite sure how to fix this. Any advice? // access multiple fields in related table
var tbl = FeatureSetByRelationshipName($feature,"UNDATA.PipelineLine_ServiceHistory");
//connecting feature
var mxloc = $feature["MXLOCATION"];
//sql expression for related tbl
var tbl_sql = "MXLOCATION = @mxloc"
var histories = Filter(tbl, tbl_sql)
var cnt = Count(histories)
//Console(cnt)
var result = "";
//Loop through each record
if (cnt > 0) {
result = cnt + " Record(s):" + TextFormatting.NewLine;
// for each record, get information and append to result output
for (var history in histories) {
var txt_mxloc = Text("Asset Number: " + history.ASSETNUM) + TextFormatting.NewLine;
var txt_date = txt_mxloc + "- Install Date: " + Left(Text(history.INSTALLDATE), 9) + TextFormatting.NewLine;
//var txt_dsc = txt_date + "- Description: " + Text(history.DESCRIPTION);
var txt_dsc = txt_date + "-Description: " + Text(Round(history.PIPELEN)) + " ft " + Text(history.DIAMTR_C) + '" ' + Text(history.PIPEMATL) + TextFormatting.NewLine;
var txt_coat = txt_dsc + "-Coating: " + Text(history.COATTYPE);
result += TextFormatting.NewLine + txt_coat;
}
}
else {
result = "No Records";
}
Console(result)
return result
... View more
05-05-2023
06:14 AM
|
0
|
2
|
707
|
POST
|
I have a feature class with an associated table set up in Utility Network. I've been trying to access the data on that table through a popup using FeatureSetByAssociations - New Utility Network Arcade API to Work with Associations (2.5/10.8) (esri.com) for information. However, all I get are null and zero count results. I tried the two below arcade snippets and am consistently getting zero counts or records. However, I'm able to check the Attribute pane and verify the points have associated table records (every point as a minimum of 1 record associated with it). The two snippets below should give something, but instead just output 0 associated records. I've tried this with data connected directly to the oracle DB and with feature layers published to Portal Enterprise (10.9.1) and then pulled back into Pro. Both had the same results. var allContent = featuresetbyAssociation ($feature, "container");
var devRow = Filter(allContent, "ASSETGROUP = 'Meter'")
var result = Count(allContent);
if (IsEmpty(result) == True) {
return "No Association"
} else {
return result
} var allContent = featuresetbyAssociation($feature, "container");
var globalids = [];
var i = 0
for (var v in allContent) {
globalids[i++] = v.globalId
}
var deviceCount = 0
if (i >0) {
var tbl = FeatureSetByName($datastore, "Pipeline Junction Object");
var rows = Filter(tbl, "globalid in@globalids")
deviceCount = Count(rows)
}
return{'errorMessage':deviceCount}
... View more
04-24-2023
12:38 PM
|
0
|
0
|
317
|
POST
|
I was following along on the ESRI blog posts about Arcade elements from early last year: https://www.esri.com/arcgis-blog/products/arcgis-online/mapping/part-2-introducing-arcade-pop-up-content-elements/ and was trying to figure out how to configure a Fields List or Text added from "Add Content" to a popup... And then I realized that all the examples were using "Arcade" from that Add Content button which wasn't available on our Enterprise Portal. What version of Enterprise was that made available in? I'm currently on 10.9.1.
... View more
03-21-2023
09:10 AM
|
0
|
1
|
539
|
POST
|
Thank you, that was the simple thing I was missing.
... View more
03-21-2023
08:47 AM
|
0
|
0
|
2027
|
POST
|
This is an arcade-specific question about using arrays. I am building a popup based off of this previous post: https://community.esri.com/t5/arcgis-online-documents/hide-field-in-pop-up-using-arcade/ta-p/1029496 and would like to create a 'master list' of field names that always apply to a popup while adding in additional fields based on the content of a specific field. So, say I have an array of ['a', 'b','c'] and a second array of ['h','j', '5']. How can I merge those two arrays together into ['a', 'b','c', 'h','j', '5'] (or any other combination of fields, the arrangement doesn't matter currently)? This is easy enough to do with Python, but I can't find a simple way to do this with Arcade. I was trying to use Insert but when I did the below code segment, I only got the indexes of the array values instead of the values themselves. var lst1 = ['a', 'b','c']; var lst2 = ['h','j', '5']; var newlst = []; for ( var i in lst2) { Insert(lst1, 0, i) } return lst1
... View more
03-21-2023
07:32 AM
|
0
|
3
|
2055
|
POST
|
I have a notebook that was created and tested on ArcGIS Pro. On pro, it works without issues. I've been trying to transition that notebook to work on a Notebook server and keep running into issues. The current problem is an Error: 999999 when trying to use a Create Database Connection code segment (as below). I've confirmed that the notebook server does have read/write permissions to the target location. # set environment settings
arcpy.env.overwriteOutput=True
# Set feature class workspace
ws = r"/arcgis/directories/pgisfile01/Compliance/MandatedModel_TestEnvironment"
# Set gdb workspace
ws_gdb = os.path.join (ws, "CI.gdb")
print(ws_gdb)
# Set layer variables
ci_masterpoints = os.path.join(ws_gdb, "Points_Prod")
# Set maximo SDE connection
sde_mx = arcpy.CreateDatabaseConnection_management(ws, 'tempmx.sde', 'ORACLE', 'dblocation','DATABASE_AUTH','username','password','SAVE_USERNAME') Does anyone have any ideas on what else to test or diagnose to figure out why I get that general error? The same code works without issue on ArcGIS Pro with the only difference being a slightly different ws variable (the Notebook server is on a LINUX machine so needs to read/write using a different path name but it points to the same location as the Pro notebook did).
... View more
04-29-2022
07:06 AM
|
0
|
1
|
521
|
POST
|
I have a script that, among other things, conducts a Clip operation between two line feature classes. When I run the script in Spyder, I get ~3000 features in the resulting clip. When I run that same script in an ArcGIS Notebook in Pro, I get ~30 features. I assume this is an issue caused by 'on the fly' projection in Pro. However, I'm also unable to use the Project tool on either feature class. One is in WGS 1984 Major Auxiliary Sphere projected into Web Mercator and the other is in NAD 1983 with a StatePlane projection. However, the Project tool's drop-down list of transformations all give an ERROR 000365: Invalid Geographic Transformation. This confuses me since the transformation from NAD 1983 to WGS 1984 exists and...should work, but instead just reports that error? I'm not sure what steps to take next here. I want to be able to test this script in an ArcGIS Notebook and have it work the same way it does when running outside of Pro. The script does make use of Feature layers so it will inevitably do on the fly projection when run in Pro. What can I check to try and get the Project tool to work so I can write a project into the script?
... View more
02-14-2022
07:54 AM
|
0
|
3
|
508
|
POST
|
Thank you! I had been searching for where the map's itemID was but just couldn't locate it. In retrospect, I suppose I could have used ctrl+f to and searched for the map's item id...
... View more
11-19-2020
02:46 PM
|
0
|
0
|
1953
|
POST
|
I needed to make changes to the JSON of an existing web map that is part of a web app. Before replacing it, I want to test the JSON changes on a new web map. The new web map is a near duplicate the replacement--including its data sources, published services, and the layer ID. The main difference is in the itemIDs it uses to reference several feature layers. The Web App uses a lot of configured widgets including different Searches, Group Layers, and the eSearch widget. I don't want to have to re-do any of those. Is there an easy location within the Web App's JSON I can change to point to the new web map instead?
... View more
11-19-2020
02:38 PM
|
0
|
2
|
1969
|
POST
|
Hello Martin, Are there ESRI support articles on those bugs? I couldn't locate them on the support page.
... View more
10-01-2020
08:47 AM
|
1
|
0
|
2972
|
POST
|
Thank you for the help! I don't believe there is a good way to filter the polygons. The fields are identical for all overlapping polygons (they directly overlap and are essentially duplicates) except for two fields: The name of an attachment and a URL to that attachment. I'm not sure why this is the setup, and have no authority on making changes to the process so changes to the polygon data is unfortunately not possible. Since all the fields but for two are identical, I don't care which polygon shows the popup. I'd like to basically have it so instead of 2+ popups, I can have one popup and that popup will create a list of all the Attachment names + attachment URL in a single popup. I used $feature and $layer as you noted, and was able to produce an ugly and disorganized list (really wish I could output HTML in the arcade expressions on Portal..) It works and I end up with the below, but the main problem is I still have the 2+ popups showing up for every single polygon. Is there a way to have another expression or add to this expression a way to grab the first instance of Intersects and output only that one? var int = Intersects($layer, $feature); var cnt = Count(int); var result = ""; if (cnt > 0) { for (var i in int) { var attach = i.WorkOrdersMonthly_DOCUMENT_ + ":" + i.WorkOrdersMonthly_URLNAME; result += TextFormatting.NewLine + attach; } } else { result = "No Layers"; } return result
... View more
09-29-2020
07:21 AM
|
1
|
1
|
1483
|
POST
|
I have had no problem following the very informative blog posts and GeoNet threads on using Arcade expressions to show information from multiple overlapping layers in a single popup. However, I have a tangentially related issue that I couldn't figure out how to do using FeatureSets and Intersects in Arcade. I have a layer with multiple overlapping polygons. There are basically 2-11 duplicate polygons for each area. For various reasons due to back infrastructure and reasons I don't understand, we can't condense these into a single polygon with multiple attribute fields. I would like to have the popup for each of these show only a single time while showing a single selected field from each of the other overlapping features. However, I'm not sure how to do this or if it can even be done. So I suppose: 1) Is it possible to reference overlapping polygons within a single feature layer in a single popup? 2) And where would I start using Arcade to do that?
... View more
09-29-2020
06:04 AM
|
0
|
3
|
1532
|
POST
|
There are other features with subtypes on the layer that aren't giving the same error, so I don't think so. I'm not 100% positive though.
... View more
09-25-2020
06:17 AM
|
0
|
0
|
2972
|
Title | Kudos | Posted |
---|---|---|
1 | 10-01-2020 08:47 AM | |
1 | 09-08-2020 07:28 AM | |
1 | 09-29-2020 07:21 AM | |
3 | 09-17-2020 06:15 AM |
Online Status |
Offline
|
Date Last Visited |
07-03-2023
06:05 PM
|