-
|
Hi! Thank you in advance for your time. I have this bot: When I simulate it with any random ticket (no contact for that email address), I get this error:
As per the log, the logic seems OK:
Am I just using the Create Contact function wrong? I admit this part is not my forte so I would appreciate any help in getting this bot creating a contact for, basically, every email we get tickets from. Thanks again! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
|
Hey there! In your Changeset: JSON, you're already in the scripting context once you start It could just be That's much simpler with automations since KATA doesn't require JSON syntax to update records: https://cerb.ai/docs/automations/commands/record.create/ The You could use the email name by default (left of the This is what a start:
outcome/hasContact:
if@bool: {{message_sender_contact_id}}
then:
return:
record.create/contact:
output: new_contact
inputs:
record_type: contact
fields:
first_name: {{message_sender_address|split('@')|first}}
email: {{message_sender_address}}Policy: commands:
record.create:
deny/type@bool: {{inputs.record_type is not record type ('contact')}}
allow@bool: yesThe automation event binding (Search->Automation Events->mail.received): automation/newContacts:
uri: cerb:automation:example.mailReceived.createContacts
disabled@bool: {{message_sender_contact_id}}That will only invoke the automation if the sender doesn't have a contact record. It's much more efficient than bot behaviors since it only runs your code when it needs to. |
Beta Was this translation helpful? Give feedback.

Hey there!
In your Changeset: JSON, you're already in the scripting context once you start
{% ... %}so you don't need the{{...}}around placeholders.It could just be
email: sender_addresson line 3 in your latest screenshot.That's much simpler with automations since KATA doesn't require JSON syntax to update records: https://cerb.ai/docs/automations/commands/record.create/
The
contactrecord type also requires a first name at minimum: https://cerb.ai/docs/records/types/contact/You could use the email name by default (left of the
@).This is what a
mail.receivedautomation would look like: