I have a script which will create an entity dynamically. This entity has a single select option called “Type”.
With this as an example:
await fibery.createEntity('System/Task', {
"Name": 'Example',
"Type": "System"
});
I can create the entity without issue.
However - the issue arises if the Type field is set to required. If it is, then the script does not run, with this error:
Failed to execute Action "Script": createEntity: Cannot create entity of "System/Task" DB with missing required fields: Type
It does not matter if I give the script the name of the type, the ID of the type. This seems like a bug to me and is a huge roadblock for our project.
Hi, unfortunately we have a quirky implementation of Single Selects. It is implemented as relation field and to make your script work you have to supply the Id
of corresponding Entity (Option) which in turn for Entities is not a numeric value but hidden from UI uuid like fd6d9df1-739b-11f0-a412-73c290273077
await fibery.createEntity("Test/Card", {
Name: "name",
Type: "fd6d9df1-739b-11f0-a412-73c290273077"
})
The easiest way to get this id is to navigate to option value Entity using alt
+ click and then using alt
+ click on numerical Public Id
Thanks for replying,
We did try that, but unfortunately it gives the same result:
We tried your method, and also have tried getting the ID from getSchema() and manually finding it within there, but still no dice
I bet that you have something missed, e.g. in some other script or brunch or anything else is missing because I’ve tried my script before posting it here.
By the way Schema does have info only about types and fields meta data not about Entities, where is Options you’re looking for are Entities.
I just created a completely brand new and clean space with two equally clean databases, and did the exact same thing, and again got the same result:
It can’t be anything to do with any other script, as nothing else is in or affecting this new space and new databases.
It is quite strange, as in this case you had to get different error, which should state smth like the value you’ve supplied doesn’t exist but you got that value wan’t passed at all.
Can you share this Space as a Template and share the link here on in intercom?
Thanks for sharing it. I’ve spotted a difference in the setup. In my case I’ve a default value set for this single select and when script run I got proper non-default value selected from script but when default value is not set for a field than I got the same error as you. Which is definitely a bug needed to fix asap.
As I get it setting a default value for this field is not an option for you. Will pass it for proper developer.
1 Like
Appreciate your time, thank you.