META optimization

Referencing dynamic attributes 

There are dynamic attributes available about our story that we can reference as we build.

META data 

In a data pill, you'll see them as you type "META."

This is especially helpful when using the Tines API and wanting to reference the META.tenant.domain, which would spit out the URL for the domain. Making the URL endpoint for an HTTP request action correct no matter what tenant it is on.

Instead of writing out your tenant name (test.tines.com), you can reference META.tenant.Domain and it will dynamically write the test.tines.com for you. This is especially helpful when doing different API calls using the Tines API. It is also useful whenever you have Tines producing logs and you want to include data about that Tines story/action.

Below are a few additional examples.

You can look at the:

  • Tenant

    • Domain

      • input: META.tenant.domain

      • output: test.tines.com

    • Name

      • input: META.tenant.name

      • output: test

  • Team

    • ID

      • input: META.team.id

      • output: 123456

    • Name

      • input: META.team.name

      • output: Training Team

  • Story

    • ID

      • input: META.story.id

      • output: 1234567

    • Name

      • input: META.story.name

      • output: University examples

    • Key

      • input: META.story.key

      • output: university_examples

    • Is_test

      • input: META.story.is_test

      • output: false

  • Action

    • ID

      • input: META.action.id

      • output: 98765432

    • Name

      • input: META.action.name

      • output: Get META data

    • Key

      • input: META.action.key

      • output: get_meta_data

  • Story_run

    • ID

      • input: META.story_run.id

      • output: 591c0969-f137-43e6-a693-0a0d3d212443

Want to try it on your tenant?

Copy the below action code and paste it into your tenant and run. You'll see in the event payload sample META data that reflects your environment.

{"standardLibVersion":"32","actionRuntimeVersion":"4","agents":[{"disabled":false,"name":"Get META data","description":null,"options":"{\"mode\":\"message_only\",\"loop\":false,\"payload\":{\"tenant_domain\":\"<<META.tenant.domain>>\",\"tenant_name\":\"<<META.tenant.name>>\",\"team_id\":\"<<META.team.id>>\",\"team_name\":\"<<META.team.name>>\",\"story_id\":\"<<META.story.id>>\",\"story_name\":\"<<META.story.name>>\",\"story_key\":\"<<META.story.key>>\",\"story_is_test\":\"<<META.story.is_test>>\",\"action_id\":\"<<META.action.id>>\",\"action_name\":\"<<META.action.name>>\",\"action_key\":\"<<META.action.key>>\",\"story_run_id\":\"<<META.story_run.id>>\"}}","position":{"x":3690,"y":450},"type":"eventTransformation","timeSavedUnit":"minutes","timeSavedValue":0,"monitorAllEvents":false,"monitorFailures":false,"monitorNoEventsEmitted":null,"recordType":null,"recordWriters":[],"form":null,"cardIconName":null,"createdFromTemplateGuid":null,"createdFromTemplateVersion":null,"originStoryIdentifier":"cloud:182d03829f868533adca5fc807c21091:aae06f45d1b10e8947c468b9f9386dc9"}],"links":[],"diagramNotes":[]}

INFO data 

The info data can reference the name or ID of your Credentials, Resources, or Records. This is particularly helpful whenever you need to make an API call using Tines that requires that data. It could be updating a Resource, capturing a specific Record, or modifying a Credential access.

Below are a few additional examples.

  • Credential

    • [name of credential].id

      • input: INFO.credential.slack.id

      • output: 12345

    • [name of credential].name

      • input: INFO.credential.slack.name

      • output: Slack

    • [name of credential].metadata

      • input: INFO.credential.slack.metadata

      • output: username: Dan

  • Resource

    • [name of resource].id

      • input: INFO.resource.main_email.id

      • output: yanni@example.com

    • [name of resource].name

      • input: INFO.resource.main_email.name

      • output: Main Email

  • Record

    • [name of record].id

      • input: INFO.record.data_set.id

      • output: 12345

    • [name of resource].name

      • input: INFO.record.data_set.name

      • output: Data Set

    • [name of resource].fields.[field name].id

      • input: INFO.record.data_set.fields.timestamp.id

      • output: 12345

    • [name of resource].fields.[field name].name

      • input: INFO.record.data_set.fields.timestamp.id

      • output: Timestamp

StoryRunGUID 

Whenever a story runs it gets a unique identifier referred to as the StoryRunGUID.

For example, let's say we have a URL that we want to be analyzed by 3 different tools. At the end of the story, we want to have 1 final action with all of the results.

If we wanted to pull together all the results we could use an implode action. When we configure it, we'd use the StoryRunGUID as our GUID. Making it so we pull together all the results from that individual story run.

UUID 

UUID is a unique identifier that can be generated at any point in our story.

We just use it in a data pill and can get randomized values. This can be helpful in the way StoryRunGUID is but can be leveraged in different means. You could use it to send a one-time code to a user in an email to create an authentication flow using Tines and UUID.

Was this helpful?