I used to be able to use Python and auto-fill fields by putting the string in quotes. For some reason it hasn't been working lately. I'm using Pro v. 2.7.2. The expression verifies and the there are no errors, but the (text) fields are not populated with the string? The field length is set at 300, more than enough.
Solved! Go to Solution.
Please check if there are any undesired selected features in the input table? Ensure the table is not being edited by any other instance/application. Else reload the layer in ArcGIS Pro.
I am also using ArcGIS Pro 2.7.2, and adding an HTML path works just fine.
What if you put an r in front of that statement like this:
r"https://blah/blah.blah/blah/blah.png"
I get it to work with or without the r which is basically short for 'raw' text so any escaped characters are taken literally: see this article for a more detailed explanation.
@JoeBorgione
It didn't hurt anything, but also didn't help.
Strange. It's such a simple thing that I've always been able to do. I've also tried the same expression on a different table that has a text field with the length set to 256, which is still more than enough. It would not work either.
Please check if there are any undesired selected features in the input table? Ensure the table is not being edited by any other instance/application. Else reload the layer in ArcGIS Pro.
I am also using ArcGIS Pro 2.7.2, and adding an HTML path works just fine.
What's an example of an "undesired selected feature"?
Any feature remained selected by mistake.
I guess that might not be the case.
You may try closing all ArcGIS Pro sessions > Open a new ArcGIS Pro session > Add the table > Calculate Field.
Let us know if this resolves the issue or not.
@JayantaPoddar brings up a good point: is this feature published anywhere? You'd need to shut down the service it is associated with if so...
Well, I'm working on a hosted feature layer in Pro. So, yes, it's a published layer on AGOL. I'm signed in to my account in Pro and have added the hosted layer to the map via the Portal in the Catalog.
EDIT: I've since closed the browser which called the hosted layer then ran the field calculator again. No difference.
Are you editing the hosted feature table? If not, you may remove it from the map.
Hmm. I just upgraded from 2.7.1 to 2.7.2 and grabbed a feature layer from my agol account; it all works for me. What I meant was if the feature you are editing is the source data for a published feature layer, like an enterprise gdb feature class that you published to a portal (including agol)