I'd like to create a string attribute with a specific length. I'm using an Esri AGOL writer to create and write to a feature service. In AGOL, I want the Field length of this string to be 12.
In a PythonCaller, I'm using:
objText = '00123'
feature.setAttribute("TextField_test", 'ABC' + objText)
In AGOL, this creates a field of string type with a length of 254.
In an AttributeCreator (before the PythonCaller), I created the 'TextField_test' attribute with a value of @string(12). This creates an attribute a value of '@string(12)' which is obviously not what I want (the python overwrites that value). In AGOL, this creates a field of string type with a length of 200.
I understand that I could the User Attributes in the AGOL Writer to Manual and change the attribute to Width to 12, but I also have an Excel Writer and would have to set the Cell Width to 12 as well. During development, I'm adding and removing many attributes, and I don't want to manually change my attributes in multiple writers every time I make a change.
Any ideas on how I can create a string attribute with a length of 12 before getting to my AGOL and Excel writers? I'd like to keep the User Attributes for the writers set to Automatic.
I also just noticed that for a different attribute, I'm creating an 8 bit integer in an AttributeCreator with @int8(0) and the AGOL and Excel writers show this attribute as a string with a width of 200. That's not what I want or expect.