A component is a portion of reusable code that accomplishes a specific task, or connects with an outside service. For example, the SFTP component allows integrations to download and modify files on an SFTP server. The Slack component posts messages to Slack channels.
Several components are strung together to form an integration. A very simple integration might use the AWS S3 component to pull down a file from S3, and post the contents of the file to a Slack channel using the Slack component.
Complex integrations might be comprised of dozens of actions.
Prismatic offers a wide array of components to accomplish a variety of things, like serializing data formats, invoking REST endpoints, or interacting with commonly-used SaaS platforms like AWS, Slack, or Dropbox - see our component catalog for a full list of components. Source code for some Prismatic-provided components is available on GitHub.
You can read about components within the web app by clicking the Components link on the left-hand sidebar. For more detail about a particular component, click the Component > link of the component you want to know more about.
The majority of your integration can likely be developed using Prismatic-provided components. For the portions of your integrations that are specific to your industry or product, Prismatic provides the ability to run custom code as part of your integration. You can deploy your own code in the form of reusable custom components or short code component steps.
For More Information: When Should I Use a Custom Component vs a Code Component?
Components contain one or more actions that can be invoked. For example, the AWS S3 component contains actions to copy S3 objects, delete objects, get an object's contents, etc.
- Web App
You can view the actions of a component by clicking Components on the left-hand sidebar of the web app, and then clicking into a component. You will see the actions a component contains, required credentials to execute those actions, and inputs the actions take.
For More Information: Custom Component Actions
Component Authorization Methods
Some components require credentials to interact with a SaaS provider, REST endpoint, etc. Those credentials might be username/password sets, API keys, OAuth2 tokens, etc.
To see what authorization methods a component can use, click the Components link on the left-hand sidebar and select a component. Authorization methods will be listed in the component description page.
Component Action Inputs
Component actions take inputs, and execute on those inputs accordingly. Inputs might include a RESTful URL endpoint, an S3 bucket name, or a Slack webhook to invoke. Inputs can be static strings (perhaps a URL for a HTTP request), or can be a variable based on a config variable or output of a previous action.
JSONata Input Mode
If, for example, you have a configuration variable named
myApiUrl equal to
http://some-api.com/, and you would like to generate a URL of the form
https://some-api.com/some/rest/endpoint, you can enter
configVars.myApiUrl & 'some/rest/endpoint' when in JSONata mode.
You can use JSONata functions within your input.
For example, if a previous step named
get_todo_items output an array named
todos, like in the getting started example, you could generate a string as input reading
"You have " & $count(outputs.get_todo_items.todos) & " tasks to complete.".
- Web App
Simple Input Mode
In addition to JSONata mode, the web app provides an input mode called simple mode.
To switch to simple mode, click the
Once you tap
= you will be presented a dialogue that auto-fills possible configVars and output values.
Once you are satisfied with your input, you can optionally click the icon again to translate your simple mode input back to JSONata mode.
Component Action Outputs
Some component actions return results that can be read in as inputs in subsequent steps.
That output can be referenced by referencing the
outputs.STEP_NAME.OUTPUT_NAME variable in an input field.
Component Action Output Example
You could select a random "TODO" item and send its title as a Slack message using the JSONata
To do that, reference
Reusable Output Expressions
In the previous example the output of an HTTP GET action was mutated as input for a subsequent Slack step.
What would happen, though, if you needed that same TODO item title in multiple steps?
You could enter the expression
$shuffle(outputs.httpget.all).title for the input of each step, but that would select a different random TODO item each time.
Instead, we want to select a TODO item title, and use that same title throughout.
You can create a named output on the HTTP GET step, and reference that output in multiple subsequent steps.
In this example we save
$shuffle(outputs.httpget.all).title to an output named
randomTodoTitle, and reference
outputs.httpget.randomTodoTitle in a subsequent step.
Like input, output can be formatted using JSONata syntax, or be strung together in simple mode (described in inputs above)