Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API returning different name for fields #93

Open
jamesvclements opened this issue May 24, 2023 · 2 comments
Open

API returning different name for fields #93

jamesvclements opened this issue May 24, 2023 · 2 comments

Comments

@jamesvclements
Copy link

My collection has a field named Summary:
Webflow - Lux Capital-Wednesday-May-24-2023-02 53 03PM@2x

The API is returning the field as 'description-3':
GET newsletter item - My Workspace-Wednesday-May-24-2023-02 54 33PM@2x

summary isn't found in GET or PATCH or POST calls. Is this the best repo to submit bugs to the Webflow API as a whole?

@Jeandcc
Copy link

Jeandcc commented Jun 15, 2023

This is not a bug. That field name on the API is set when you create the field, and never changes, even if you change it through the Webflow CMS. Once the field was created with the name X, it will always have that name.

Also, if you delete a field and create a new one with the same name, the new field will not be able to have the original name, say "summary". Webflow will always increment a number to the end of the field name so field names never repeat in the back-end.

What you can do to improve the work on your end is to create a helper function that gets the field slug from the field name. For that you will need to fetch the collection schema from the CMS API.

@nlbdotdev
Copy link

nlbdotdev commented Oct 11, 2023

Is there any way to deeply delete a field so that the field name is available again? It's especially inconvenient to work with dashes as object field names and makes types dirty with arbitrary numbers...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants