Overview
The Microsoft Teams integration provides a set of ready-made functions you can call when building mappings. They help you build the content of a Teams message and resolve a channel by name, so you do not have to write that logic yourself in a formula.
Where you can use these functions
These functions are available anywhere you write a formula for the Microsoft Teams integration:
Dynamic Formula mappings: where a destination field's value is produced by a formula rather than mapped directly from a source field.
Mapping collection filters: where a formula decides whether a record should be processed.
Error filters: a mapping collection's error filter, which sits alongside its collection filter. When the error filter's formula resolves to true, the transfer raises an error that is held in the Error Logs for review and is not retried automatically.
Translation collections: where a translation entry uses a formula as its source value.
How to use them
Call a function by name and pass the values it needs in parentheses, for example:
await GetChannelByName(SourceChannel).Each function's signature shows its name, the parameters it accepts (with their types), and the type of value it returns. Use it as the reference for exactly how to call the function.
Function names and formula syntax are case-sensitive, so type each name exactly as shown. Whether the values a function matches are treated as case-sensitive varies by function, and is called out in the relevant parameter's description.
Every function that returns a
Taskis asynchronous and must be called withawait, as shown in each How to call it example.Optional parameters are marked in the parameter table, along with the value used when you omit them.
Each function runs at sync time, against the data in your connected Microsoft Teams account and your iPaaS.com subscription.
The functions are grouped below by the area of the integration they support.
Messages
GenerateMessageContent
What it does: Builds the content string for a Microsoft Teams message from a headline, a detail block, a set of detail fields, and an optional detail link.
Signature: Task<string> GenerateMessageContent(string text, string detail = null, object links = null, object detail_fields = null)
How to call it: await GenerateMessageContent(text, detail, links, detailFields)
Parameter | Type | Required | Default | Description |
|
| Yes | N/A | The message headline text. |
|
| No |
| The detail text added below the detail fields. The function returns nothing unless |
|
| No |
| Links to include. Only the |
|
| No |
| The detail fields to show, using the keys |
Returns: string. The formatted Microsoft Teams message content. It returns null unless text, detail, and detail_fields are all provided.
Example: await GenerateMessageContent("Invalid JSON", "The error occurs due to invalid JSON", links, detailFields) returns a message that combines the detail fields, the detail text, and a Detail link.
When to use it: Use this in a Dynamic Formula mapping for a Microsoft Teams message content field to build a consistent, readable message.
Channels
GetChannelByName
What it does: Looks up a Microsoft Teams channel by name and returns its channel ID. The name match is case-insensitive; if no channel matches the name, the first channel is used.
Signature: Task<string> GetChannelByName(string channelName = null)
How to call it: await GetChannelByName(channelName)
Parameter | Type | Required | Default | Description |
|
| No |
| The Microsoft Teams channel name to look up. If it is empty or omitted, the function returns an empty string. |
Returns: string. The Microsoft Teams channel ID for the named channel, or the first channel's ID when no channel matches the name. Returns an empty string when no channel name is given.
Example: "TestChannel" returns the channel ID of the Microsoft Teams channel named TestChannel.
When to use it: Use this in a mapping for a channel ID field when you have the channel by name and need its Microsoft Teams channel ID.
