Select to view content in your preferred language

Google Sheets to Feature layer: Removing underscores from display name quickly?

496
2
09-06-2023 04:08 PM
Labels (1)
hoshijun
New Contributor II

I have a Google Sheets with many columns/fields. When I import it into AGOL as a feature layer, the Display Names all automatically have underscores instead of spaces. 

I would rather not manually go through each one since there are many. I also plan to update the data through Sheets occasionally so I'm worried that the names would reset.

Is there an easy way to change them back to spaces? Or a way to avoid the underscores from appearing when I import the sheet?

 

0 Kudos
2 Replies
RhettZufelt
MVP Notable Contributor

Easiest way to avoid the underscores is to remove the unsupported column name characters (space) from the Google Sheet in the first place.

Field Name—Field names cannot contain special characters, such as spaces, hyphens, parentheses, brackets, or characters such as $, %, and #. Avoid using field names that contain words that are typically considered database-reserved keywords, such as CHARACTER or DATE.

R_

0 Kudos
hoshijun
New Contributor II

Hi R,

Thanks for the suggestion. The issue is I'd like to keep the display names with spaces included. I discovered that if I download the Google sheet into a CSV and then upload it to AGOL, it will automatically keep the spaces in the Display Name while the feature name has the underscores.

0 Kudos