Are the databases related? If not, then the only way is with a script.
If they are related, you should see an ‘Add Task’ option in the Action button. Then you can use a formula to set the name of the Task.
Something like [Step 1 Action].Name should work.
Yes, that guide is where to start if you want to script stuff, but I’d also be curious as to whether it might make sense to create a relationship between the dbs, if only to make this automation easier.
You can even hide the relation in views where you don’t need it.
I would rather have not the relation in, as it keeps the workspace map cleaner and also it is a different type of relation compared to all other relations (but maybe i am overthinking it lol).
Ok your part of the script works (obv :D) - now i am trying to update the description of the task but it says the setDocumentContent is not defined. What am i doing wrong?
// Developer reference is at api.fibery.io/#action-buttons
// Fibery API is used to retrieve and update entities
const fibery = context.getService('fibery');
// affected entities are stored in args.currentEntities;
// to support batch actions they always come in an array
for (const entity of args.currentEntities) {
// an entity contains all fields apart from collections;
// to access a field refer to it by its UI name
const thenewtask = await fibery.createEntity('V2 Product Management/Task', { 'Name': entity['name'] });
console.log(args.currentEntities['0']);
console.log(thenewtask);
const descrid = thenewtask['description']//.map(({ secret }) => secret);
console.log(descrid.secret)
await setDocumentContent('descrid.secret', 'teststring');
//await fibery.createEntity('V2 Product Management/Task', {'Description':"test"});
// await fibery.updateEntity(entity.type, entity.id, {
// 'Field Name': newValue
// });
}
i integrated your email template space to import emails from gmail (awesome btw!!)
now i have CRM Space and have set up the relation to automatically link contacts by email.
but sometimes a contact has not been setup - and I want to have a button to create a new contact with a click.
If I have a couple databases that have a many-to-many relation, can I used an automation (button or rule)?
Is it just the “automatically link” checkbox kind that doesn’t work?
I think you are referring to that “automatically link” checkbox.
By the way, I can’t seem to wrap my head around what the “automatically link” checkbox does in general. I’ve read the Fibery materials and still don’t understand it (my issue not Fibery’s) - could you explain it in a very basic manner?
An auto-relation can be thought of as a normal relation, except that Fibery takes care of linking items based on them matching on specific criteria.
So for example, you could have a database of employees and auto-link it (one-to-one) to the user database, based on a match between the email field in each db.
That way, for each employee you would see a link to their user account (if they have one - perhaps some employees are not users) and for each user you can see a link to the corresponding employee entity (if there is one - perhaps some users are not employees).
The db fields created by an auto-relation (one at each end of the relation) are read-only. Users can’t link/unlink entities - the whole point is that Fibery links entities when there are matches.
This means that some of the automation actions usually available for relation fields, e.g link/unlink/add/delete are not available.
In your case, if you (only) have an auto-linking relation between the gmail contact db and the ‘normal’ contact db, you can’t use an automation in the google contact db to create a ‘normal’ contact since this action will not be available.
So your choice is to create a dummy relation, whose sole purpose is to provide this capability (and still rely on the auto-linking to connect entities where possible) or to write a script, since a script can do stuff that isn’t possible with standard no-code actions.