I have a script and I want to let user type in a value (text). My problem is the user has to put " " for the value they want for any of the newly added fields. ex: "virginia" works virginia does not work. How can I get the toolbox to work without the user typing " " and just type the value. I have looked at the properties parameters of the script and have the data type set to String or Any Value but nothing works. I could find anything online to fix this.
inMosaic = arcpy.GetParameterAsText(0)
yearfield = arcpy.GetParameterAsText(1)
installfield = arcpy.GetParameterAsText(2)
sitefield = arcpy.GetParameterAsText(3)
groupnamefield = arcpy.GetParameterAsText(4)
productnamefield = arcpy.GetParameterAsText(5)
fieldNames = ["YEAR", "INST_ABBR", "SITE_ABBR"]
aliasNames = ["Year", "Installation Abbreviation", "Site Abbreviation"]
fieldsExisting = {f.name: f.type for f in arcpy.ListFields(inMosaic)}
count = 0
for fName in fieldNames:
if fName not in fieldsExisting.keys(): # Check if field is not already present in the Mosaic Dataset attribute table
arcpy.AddField_management(inMosaic, fName, "TEXT", field_alias=aliasNames[count], field_length=10) # If not, add field
arcpy.AddMessage("{0} field has been added to Mosaic Dataset!".format(fName))
count += 1 # Increase counter for each loop. This is necessary for iterating through the aliasNames list
arcpy.management.CalculateField(inMosaic,"YEAR", yearfield)
arcpy.management.CalculateField(inMosaic,"INST_ABBR", installfield)
arcpy.management.CalculateField(inMosaic,"SITE_ABBR", sitefield)
arcpy.management.CalculateField(inMosaic,"GroupName", groupnamefield)
arcpy.management.CalculateField(inMosaic,"ProductName", productnamefield)