calculate field add string multiple fields

2270
14
Jump to solution
04-08-2021 01:24 PM
JaredPilbeam2
MVP Regular Contributor

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.

cal.png

cal2.png

 

0 Kudos
1 Solution

Accepted Solutions
JayantaPoddar
MVP Esteemed Contributor

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.

Jayanta_Poddar_0-1617915923537.png

 



Think Location

View solution in original post

14 Replies
JoeBorgione
MVP Emeritus

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. 

That should just about do it....
0 Kudos
JaredPilbeam2
MVP Regular Contributor

@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.

JayantaPoddar
MVP Esteemed Contributor

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.

Jayanta_Poddar_0-1617915923537.png

 



Think Location
JaredPilbeam2
MVP Regular Contributor

@JayantaPoddar 

What's an example of an "undesired selected feature"?

0 Kudos
JayantaPoddar
MVP Esteemed Contributor

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.



Think Location
0 Kudos
JoeBorgione
MVP Emeritus

@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...

That should just about do it....
0 Kudos
JaredPilbeam2
MVP Regular Contributor

@JoeBorgione @JayantaPoddar 

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.

0 Kudos
JayantaPoddar
MVP Esteemed Contributor

Are you editing the hosted feature table? If not, you may remove it from the map.



Think Location
0 Kudos
JoeBorgione
MVP Emeritus

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)

 

JoeBorgione_0-1617917474650.png

 

That should just about do it....
0 Kudos