I thought the automation discussion is probably off-topic so I thought I would move the discussion here.
The solution provided above only works if the Task entity has a direct relation to the Meeting entity. In some cases, there isn’t direct relation (e.g. the task and meeting are both related to a Project entity but not to each other) so I was thinking the only way is to use the References. However, when I retrieve the References object, it only seems to provide the Ids and not the referencing entity type.
Has anyone ever worked with References objects through the API? Is it possible to actually retrieve the original entity/entities that referred to the current entity and grab some of their attributes? fibery.getEntityById() seems to require the type.
or you could add a relation between Meetings and Tasks
Unfortunately, I think you’re right that it is not possible to get the type of an entity just from knowing its Id, so unless you already know the type(s) of the referring entities, it will be hard (or at least long-winded) to figure it out.
Perhaps @Sergey_Truhtanov or someone else would like to chip in (or even add functionality to retrieve an entity’s type from its Id)
With respect to the issue of linking a Task to the Project that a referring Meeting is owned by, I think you could iterate through the referring entities to find only those which are of the Meeting type, and link to the parent Project when a match is found.
Of course, it begs the question of what should happen if multiple Meetings (with different Project parents) refer to the same Task. I had assumed that you would only want to link a Task to a single Project.
So you create a Task in a Meeting entity, by selecting some text of a Meeting and converting it to an Entity. And you want those Task to automatically inherit Project of a Meeting.
Unfortunately it is not possible at the moment. We have some direct plans for more intelligent References support in formulas. As we suffer ourselves from not being able to make some further calculations on References of concrete type. Like Refereces.Filter(Type = "Feature").Sum([Some Feature field here]).
But cannot make any concrete promise of when this will be implemented, need to find out right solution first.
Is it possible have fibery.getEntityById() to return both the ID and Type of each referring entity? Then we can use fibery.getEntityById() again to iterate over the references and do some more interesting things.
Be a bit careful with that “Created” trigger by the way. As there are many places to create an entity in Fibery, it may appear that some fields will be empty in your script, if for example entity is created from a table or smth like this. If you need to always update some state on field change, I recommend to use “Updated” trigger and selecting field you need to subscribe to. But this is just a general note, may not be applicable to your case.