I am brand-new to Tines. I’m not a programmer. I t...
# community-help
m
I am brand-new to Tines. I’m not a programmer. I think there might be opportunities to incorporate logic into my stories with triggers and event transforms but I am not skilled in how to edit them. I have accessed Tines documentation but I cannot seem to find anything that resonates with me. I am attempting to write stories for a non-security related use case. My goal is to use my stories to enroll customers in fictious training from Contoso Education. I’m wondering how to incorporate logic into my stories. For example, how to get user name, course name, course date added to automated emails. A second example would be redacting user passwords when emails are sent to the operations team. Annotations for each of my stories are described below: New Contoso Education Account The goal of this story is to establish a new Contoso Education account. To enroll in a course, students that want to take Contoso training must have an account in the LMS in order to enroll in a course. To establish an account, prospective students must complete the form associated with this story. The new account story should generate a unique user ID and a confirmation email with login credentials (which are captured in the form associated with this story.) The registration email, with a redacted user password, would also be sent to the fictional Contoso Education Operations team. Contoso Education Enrollment Form This story aims to enroll a person in a training course. To enroll in a course, you must have an account in the LMS. If this is the first time the student is enrolling in a Contoso course, the new account story should run, then redirect the student back to the course enrollment story. To complete enrollment in a course, the student must complete the form associated with this story. After enrolling in a course, students will be sent a confirmation email. The fictional Contoso Education Operations team will also receive a copy of the enrollment email. (Presumably, another story preparing the student's training materials and lab access credentials would run and be sent to the student on the start date for their training.) Am I being too ambitious? Thanks for your insights!
g
Welcome to Tines @miniature-crayon-82650! Sounds like you could use a Tines Form as the starting point for both of those use cases. You simply switch to the Form view in your Story and define all your fields etc. Then you can create a Webhook in your Story and point the Form at that. From then on, you can use all the Actions in Tines to process the data arriving on that Webhook e.g. extract the email address and send an email confirmation to the submitter. Does that help? See: https://hub.tines.com/docs/stories/forms
m
Hi Conor. Thanks for your reply. I am using a form and have pointed it to a webhook. I guess my question is how to parse the information in the form and individual bits to setup triggers, e.g.
Thank you, Martin! I will give it a try.
Thanks again, @great-beach-70934. Another question, in my form, is it possible to include a yearly calendar? Then use `{} webhook_action.body.start_date`to reference the date in my story and return email.
Hi Martin, I've been struggling with getting my story to work, so I went back to the sample provided earlier in this thread. When I completed the form and clicked Submit, I checked the logs for USA trigger. This is what I see:
Copy code
Rules did not match. Nothing to emit.
Found 0 matches from the required 1.
Rule results:
[
  {
    "type": "field==value",
    "path": "<<webhook_action.body.location>>",
    "field": "[\"USA\"]",
    "value": "USA",
    "matched": false
  }
]
Is something amiss in the sample story or am I missing something obvious? I checked the same in my story and it doesn't populate the "field" value.
g
@miniature-crayon-82650 It looks like Location is an array of values. What does it contain when you expand it? Can you maybe try webhook_action.body.location[0] for the path?
g
ah sorry my mistake, I made that on a slightly different version of Tines! As @gorgeous-soccer-85989 said
webhook_action.body.location[0]
would work, and so would
FIRST(webhook_action.body.location)
. We just need to make sure that we’re looking in the right place!
m
Does the [0] indicate the first option in the drop-down menu on the form? Or does it identify the position within the form? For example, "Location" = {}webhook_action.body.location[0] is the position from which to pull the selected location entry?
g
The [0] there means to look at the first item in the array of selected options. In this case, there will only ever be one country selected, so it will always be in the first position. But if you enabled multi select on that field and let the user select more than one country, then there would be more items returned. But for us, just looking at the first item will be completely consistent no matter what they choose.