# MailThreadsByFolder ## Documentation The e-mail conversations in one folder of the mailbox: inbox, drafts, sent or archive. Each request costs 20 tokens of the daily budget of the company. - Catalog: `Pipedrive` - Schema: `Mail` - Primary Keys: `id` This is a read-only table function. The Pipedrive API may not support changing the data or the Invantive UniversalSQL driver for Pipedrive does not cover it. In the latter case, please use the table NativePlatformScalarRequests to upload data to the Pipedrive API. ## Parameters of Table Function The following parameters can be used to control the behaviour of the table function `MailThreadsByFolder`. A value must be provided at all times for required parameters, but optional parameters in general do not need to have a value and the execution will default to a pre-defined behaviour. Values can be specified by position and by name. In both cases, all parameters not specified will be evaluated using their default values. Value specification by position is done by listing all values from the first to the last needed value. For example: a `select * from table(value1, value2, value3)` on a table with four parameters will use the default value for the fourth parameter and the specified values for the first three. Value specification by name is done by listing all values that require a value. For example with `select * from table(name1 => value1, name3 => value3)` on the same table will use the default values for the second and fourth parameters and the specified values for the first and third. | Name | Data Type | Required | Default Value | Documentation | |---|:---:|:---:|:---:|---| | `folder` | `varchar2` | ☑ | | The folder. | ## Columns of Table Function The columns of the table function `MailThreadsByFolder` are shown below. Each column has an SQL data type. | Name | Data Type | Label | Required | Documentation | |---|:---:|---|:---:|---| | `account_id` | `varchar2` | | ☐ | The connection account ID. | | `add_time` | `datetime` | | ☐ | The time when the mail thread was inserted to database. | | `all_messages_sent_flag` | `varchar2` | | ☐ | The all messages sent flag. | | `archived_flag` | `int64` | | ☐ | Whether the mail thread is archived. | | `deal_id` | `int64` | | ☐ | The ID of the deal. | | `deal_status` | `varchar2` | | ☐ | Status of the deal. | | `deleted_flag` | `varchar2` | | ☐ | The deleted flag. | | `drafts_parties` | `varchar2` | | ☐ | Parties of the drafted mail thread. | | `external_deleted_flag` | `varchar2` | | ☐ | The external deleted flag. | | `first_message_timestamp` | `datetime` | | ☐ | The time when the mail thread has had the first message received or created. | | `first_message_to_me_flag` | `varchar2` | | ☐ | The first message to me flag. | | `folder` | `varchar2` | | ☐ | The folder the rows were read for. | | `folders` | `varchar2` | | ☐ | Folders in which messages from thread are being stored. | | `has_attachments_flag` | `varchar2` | | ☐ | The has attachments flag. | | `has_draft_flag` | `varchar2` | | ☐ | The has draft flag. | | `has_inline_attachments_flag` | `varchar2` | | ☐ | The has inline attachments flag. | | `has_real_attachments_flag` | `varchar2` | | ☐ | The has real attachments flag. | | `has_sent_flag` | `varchar2` | | ☐ | The has sent flag. | | `id` | `int64` | | ☑ | ID of the mail thread. | | `last_message_received_timestamp` | `datetime` | | ☐ | The last time when the mail thread has had a message received. | | `last_message_sent_timestamp` | `datetime` | | ☐ | The last time when the mail thread has had a message sent. | | `last_message_timestamp` | `datetime` | | ☐ | Last message timestamp. | | `lead_id` | `varchar2` | | ☐ | The ID of the lead. | | `mail_link_tracking_enabled_flag` | `varchar2` | | ☐ | The mail link tracking enabled flag. | | `mail_tracking_status` | `varchar2` | | ☐ | Mail tracking status. | | `message_count` | `int64` | | ☐ | An amount of messages. | | `parties_from` | `varchar2` | | ☐ | Senders of the mail thread. | | `parties_to` | `varchar2` | | ☐ | Recipients of the mail thread. | | `read_flag` | `varchar2` | | ☐ | The read flag. | | `shared_flag` | `varchar2` | | ☐ | The shared flag. | | `smart_bcc_flag` | `varchar2` | | ☐ | The smart bcc flag. | | `snippet_draft` | `varchar2` | | ☐ | A snippet from a draft. | | `snippet_sent` | `varchar2` | | ☐ | A snippet from a message sent. | | `snippet` | `varchar2` | | ☐ | A snippet. | | `subject` | `varchar2` | | ☐ | The subject. | | `synced_flag` | `varchar2` | | ☐ | The synced flag. | | `update_time` | `datetime` | | ☐ | The time when the mail thread was updated in database received. | | `user_id` | `int64` | | ☐ | ID of the user whom mail message will be assigned to. | | `version` | `decimal` | | ☐ | Version. |