

# Reading from Slack entities
<a name="slack-reading-from-entities"></a>

 **Prerequisites** 
+  A Slack object you would like to read from. 

 **Supported entities** 


| Entity | Can be Filtered | Supports Limit | Supports Order By | Supports Select \$1 | Supports Partitioning | 
| --- | --- | --- | --- | --- | --- | 
| conversations | Yes | Yes | No | Yes | Yes | 

 **Example** 

```
slack_read = glueContext.create_dynamic_frame.from_options(
    connection_type="slack",
    connection_options={
        "connectionName": "connectionName",
        "ENTITY_NAME": "conversations/C058W38R5J8"
    }
)
```

 **Slack entity and field details** 


| Entity | Field | Data Type | Supported Operators | 
| --- | --- | --- | --- | 
| conversations | attachments | List | NA | 
| conversations | bot\$1id | String | NA | 
| conversations | blocks | List | NA | 
| conversations | client\$1msg\$1id | String | NA | 
| conversations | is\$1starred | Boolean | NA | 
| conversations | last\$1read | String | NA | 
| conversations | latest\$1reply | String | NA | 
| conversations | reactions | List | NA | 
| conversations | replies | List | NA | 
| conversations | reply\$1count | Integer | NA | 
| conversations | reply\$1users | List | NA | 
| conversations | reply\$1users\$1count | Integer | NA | 
| conversations | subscribed | Boolean | NA | 
| conversations | subtype | String | NA | 
| conversations | text | String | NA | 
| conversations | team | String | NA | 
| conversations | thread\$1ts | String | NA | 
| conversations | ts | String | EQUAL\$1TO, BETWEEN, LESS\$1THAN, LESS\$1THAN\$1OR\$1EQUAL\$1TO, GREATER\$1THAN, GREATER\$1THAN\$1OR\$1EQUAL\$1TO | 
| conversations | type | String | NA | 
| conversations | user | String | NA | 
| conversations | inviter | String | NA | 
| conversations | root | Struct | NA | 
| conversations | is\$1locked | Boolean | NA | 
| conversations | files | List | NA | 
| conversations | room | Struct | NA | 
| conversations | upload | Boolean | NA | 
| conversations | display\$1as\$1bot | Boolean | NA | 
| conversations | channel | String | NA | 
| conversations | no\$1notifications | Boolean | NA | 
| conversations | permalink | String | NA | 
| conversations | pinned\$1to | List | NA | 
| conversations | pinned\$1info | Struct | NA | 
| conversations | edited | Struct | NA | 
| conversations | app\$1id | String | NA | 
| conversations | bot\$1profile | Struct | NA | 
| conversations | metadata | Struct | NA | 

 **Partitioning queries** 

 Additional spark options `PARTITION_FIELD`, `LOWER_BOUND`, `UPPER_BOUND`, `NUM_PARTITIONS` can be provided if you want to utilize concurrency in Spark. With these parameters, the original query would be split into `NUM_PARTITIONS` number of sub-queries that can be executed by spark tasks concurrently. 
+  `PARTITION_FIELD`: the name of the field to be used to partition query. 
+  `LOWER_BOUND`: an inclusive lower bound value of the chosen partition field. 

   For date, we accept the Spark date format used in Spark SQL queries. Example of valid value: `"2024-07-01T00:00:00.000Z"`. 
+  `UPPER_BOUND`: an exclusive upper bound value of the chosen partition field. 
+  `NUM_PARTITIONS`: number of partitions. 

 Entity wise partitioning field support details are captured in below table. 


| Entity Name | Partitioning Field | Data Type | 
| --- | --- | --- | 
| conversations | ts | String | 

 **Example** 

```
slack_read = glueContext.create_dynamic_frame.from_options(
    connection_type="slack",
    connection_options={
        "connectionName": "connectionName",
        "ENTITY_NAME": "conversations/C058W38R5J8",
        "PARTITION_FIELD": "ts"
        "LOWER_BOUND": "2022-12-01T00:00:00.000Z"
        "UPPER_BOUND": "2024-09-23T15:00:00.000Z"
        "NUM_PARTITIONS": "2"
    }
)
```