Problem: Different field name in Fibery API depending on the database

I am using JS Fibery API (https://api.fibery.io/) to create an entity (i.e. Feature or Bug). I use this piece of code to create an entity:

  const entity = await fibery.entity.createBatch([
      {
        'type': `${fiberySpace}/${fiberyDatabase}`,
        'entity': {
          [`${fiberySpace}/Name`]: entityName,
        }
      }
    ]);

The code works fine for database called “Product Area” in space “Product”, but when I tried to apply the same for entity “Feature” in the space “Product”, I got an error saying fibery cannot find “Product/Name” in “Feature”. It turned out that it was named “Product/name” (so, lowercase, but referring to the same field: Name) and I don’t see any particular reason why it should be the case since Fibery autogenerates this field at the time when we create a database. Furthermore, it is the case as well for another space called “Development” where I have databases “Dev Task” and “Bug”.

Do You know any reason why it could be the case and how it can be fixed? Any form of help is much appreciated!

Hello,
Unfortunately, we do not enforce that field name on backend. UI selects name field using “ui/title?” meta flag on field object

fieldObject["fibery/meta"]["ui/title?"] === true

So, you have to consult Schema Fibery API before making any queries.
You may try using our Fibery GraphQL API as it is more forgiving in this terms and also has query editor with hints.

1 Like