UiPath Integrations

Quickstart - Search, Download, and Reply

Overview

The purpose of this guide is to help you create a working sample with different Slack activities, including Search, Download File, Reply, and Get Replies.

This working sample enables you to quickly verify the connection to your Slack workspace and get familiar with the included activity's input/output datatypes.

After completing the steps in this guide, you'll have an automation sequence that does the following:

  1. Establishes a connection to your Slack workspace (Slack Scope).
  2. Searches a Slack channel using key words and returns the results (Search).
  3. Downloads the first file found during the Search activity (Download File).
  4. Replies, with an attachment, to the first message found during the Search activity (Reply).
  5. Verifies the results of the Reply and Download File activities by outputting the names of the downloaded and attached files (Get Replies and Write Line).
Quickstart message sequence diagram (how it works)

Quickstart message sequence diagram (how it works)

Prerequisites

Before you begin:

  1. Complete the Slack Setup steps.
  2. Send a message, with an attachment, to the Slack channel you're connecting to via the Slack Scope activity. Your message should include a unique keyword that you can use in the Search activity's Query property
    • When creating this guide, our message was: "Attached is a demo file" and our attached file name was DemoFile.docx .

Steps

Build your project

  1. Add the Slack Scope activity to your project.
    1. Enter the ClientID for your Slack app.
    2. Enter the ClientSecret for your Slack app.
      • For more information about the Client ID and Client Secret, see Create new Slack app in the Setup guide.
    3. From the Scopes drop-down list, select all of the listed scopes.
    4. Click the Connect button in the Design Panel.
  2. Add the Search activity in the Slack Scope activity.
    1. Enter a search Query using the same search modifiers that you use in the Slack application (e.g., "in:#slack-quickstart demo file").
      • For more information, see Search in Slack in the Slack help documentation.
    2. Create and enter a SlackFile variable for the FirstFileFound output property (e.g., firstFileFound).
      • When creating your variable, select UiPath.Slack.Models.SlackFile as your variable type.
    3. Create and enter a Message variable for the FirstMessagFound output property (e.g., firstMessageFound).
      • When creating your variable, select UiPath.Slack.Models.Message as your variable type.
  3. Add the Download File activity after the Search activity.
    1. In the File property, enter the SlackFile variable you created for the FirstFileFound property in the Search activity (e.g., firstFileFound).
    2. In the Path property, enter the local path that you want to download the file to. For the purposes of this guide, append a new file name to the end of your local path (e.g., "C:\UiPath_Projects\ReplyFile.docx")
      • For more information about the Path property and the naming of files, see Path in the Download File activity details page.
  4. Add the Reply activity after the Download File activity.
    1. In the Message property, enter the Message variable you created for the FirstMessageFound property in the Search activity (e.g., firstMessageFound).
    2. Enter your reply Text.
    3. In the File property, enter the same value you entered in the Download File activity (e.g., "C:\UiPath_Projects\ReplyFile.docx").
      • While it's good practice to create and enter a Message variable for the Reply output property, for this example you don't need to because it's not applicable when you verify the activity results.

Test your project

  1. To verify your reply message and attached file were sent successfully, add the Get Replies activity after the Reply activity.
    1. In the Message property, enter the Message variable you created for the FirstMessageFound property in the Search activity (e.g., firstMessageFound).
    2. Create and enter a Message[] variable for the Replies output property (e.g., replies).
      • When creating your variable, select UiPath.Slack.Models.Message[] as your variable type.
  2. To process and see the output of your reply, add the For Each and Write Line activities after the Get Replies activity.
    1. In the TypeArgument property, select UiPath.Slack.Models.Message.
    2. In the Values property, enter the Message[] variable you created for the Replies output property in the Get Messages activity (e.g., replies).
    3. For the Text property in the Write Line activity, enter item.Files(0).FileName to output the name of the file that you attached.
  3. Add another Write Line activity after the For Each activity.
    1. In the Text property, enter firstFileFound.FileName to output the name of the file that was found during the Search activity.
  4. Click Start and verify the results in the output window.

You're done!

When you're ready, try the other Quickstart guides to get more familiar with the different Slack activities.

To learn more about the Slack activities (including example property inputs/outputs), see the Activities page for a complete activity list and links to the activity detail pages.

Updated 2 months ago


Quickstart - Search, Download, and Reply


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.