Activities
latest
false
Banner background image
Classic Integrations Activities
Last updated Apr 22, 2024

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).



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.
  2. Enter the ClientID for your Slack app.
  3. 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.
  4. From the Scopes drop-down list, select all of the listed scopes.

    * For more information about scopes, see Add app permissions in the Setup guide.

  5. Click the Connect button in the Design Panel.

    * For more information about this button, see Connect and Revoke Token in the Slack Scope activity details page.

  6. Add the Search activity in the Slack Scope activity.
  7. 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.
  8. 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.
  9. 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.
  10. Add the Download File activity after the Search activity.
  11. In the File property, enter the SlackFile variable you created for the FirstFileFound property in the Search activity (e.g., firstFileFound).
  12. 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.
  13. Add the Reply activity after the Download File activity.
  14. In the Message property, enter the Message variable you created for the FirstMessageFound property in the Search activity (e.g., firstMessageFound).
  15. Enter your reply Text.
  16. 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.
  2. In the Message property, enter the Message variable you created for the FirstMessageFound property in the Search activity (e.g., firstMessageFound).
  3. 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.
  4. To process and see the output of your reply, add the and activities after the Get Replies activity.
  5. In the TypeArgument property, select UiPath.Slack.Models.Message.
  6. In the Values property, enter the Message[] variable you created for the Replies output property in the Get Messages activity (e.g., replies).
  7. For the Text property in the Write Line activity, enter item.Files(0).FileName to output the name of the file that you attached.
  8. Add another Write Line activity after the For Each activity.
  9. In the Text property, enter firstFileFound.FileName to output the name of the file that was found during the Search activity.
  10. 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.

  • Overview
  • Prerequisites
  • Steps

Was this page helpful?

Get The Help You Need
Learning RPA - Automation Courses
UiPath Community Forum
Uipath Logo White
Trust and Security
© 2005-2024 UiPath. All rights reserved.