Overview
The Revel integration provides a set of ready-made functions you can call when building mappings. They handle common conversions and lookups for Revel, such as translating category URIs and IDs between Revel and iPaaS.com, looking up a product SKU, establishment, role, or employee PIN, describing a payment type, and formatting dates for Revel, so you don't have to write that logic yourself.
Where you can use these functions
These functions are available anywhere you write a formula for the Revel 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 GetProductSkuAsync(productUrl).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.
Some of these functions are asynchronous (their signature returns a
Task) and must be called withawait; the rest are synchronous and are called directly. Each function's How to call it example shows the correct form.Each function runs at sync time, against the data in your connected Revel account and your iPaaS.com subscription.
The functions are grouped below by the area of the integration they support.
Products and Categories
Use these when converting product and category values between Revel and iPaaS.com during mapping.
ConvertCategoriesToSpaceportIds
What it does: Converts a list of Revel category URIs into iPaaS.com category IDs, returned as the objects the API expects. Categories that cannot be mapped are skipped.
Signature: List<IPaaSApi.Model.Product.GenericRequest> ConvertCategoriesToSpaceportIds(List<string> categories)
How to call it: ConvertCategoriesToSpaceportIds(categories)
Parameter | Type | Required | Default | Description |
categories |
| Yes | N/A | The list of Revel category URIs to convert (for example |
Returns: List<IPaaSApi.Model.Product.GenericRequest>. A list of objects, each carrying a mapped iPaaS.com category ID.
Example: ConvertCategoriesToSpaceportIds(new List<string> { "/categories/123", "/categories/456" }) returns the objects for the matching iPaaS.com category IDs.
When to use it: When mapping Revel product categories to their iPaaS.com category IDs during a transfer into iPaaS.com.
ConvertIPaaSCategoriesToRevelAsync
What it does: Converts a list of iPaaS.com category assignments into Revel category URIs. Assignments without a Revel mapping are skipped.
Signature: Task<List<string>> ConvertIPaaSCategoriesToRevelAsync(object iPaaSCategories)
How to call it: await ConvertIPaaSCategoriesToRevelAsync(iPaaSCategories)
Parameter | Type | Required | Default | Description |
iPaaSCategories |
| Yes | N/A | The iPaaS.com category assignments to convert into Revel category URIs. |
Returns: List<string>. The Revel category URIs for the mapped categories (for example "/products/ProductCategory/789/"), or nothing if there is nothing to convert.
Example: await ConvertIPaaSCategoriesToRevelAsync(iPaaSCategories) returns the Revel category URIs for the supplied iPaaS.com categories.
When to use it: When mapping iPaaS.com product categories out to Revel during a transfer from iPaaS.com.
GetProductSkuAsync
What it does: Reads the SKU of a Revel product from its product URL. Returns an empty string if the product is not found, or nothing if the URL is empty or invalid.
Signature: Task<string> GetProductSkuAsync(string productUrl)
How to call it: await GetProductSkuAsync(productUrl)
Parameter | Type | Required | Default | Description |
productUrl |
| Yes | N/A | The Revel product URL to read the SKU from (for example |
Returns: string. The Revel product SKU, an empty string if the product is not found, or nothing if the URL is empty or invalid.
Example: await GetProductSkuAsync("/products/12345/") returns the SKU of Revel product 12345.
When to use it: When mapping a Revel product reference and you have the product URL but need its SKU.
GetAlternateIds
What it does: Looks up a list of iPaaS.com alternate IDs and returns the product SKUs that match. IDs with no match are skipped.
Signature: List<string> GetAlternateIds(List<string> ipaasAltIds)
How to call it: GetAlternateIds(ipaasAltIds)
Parameter | Type | Required | Default | Description |
ipaasAltIds |
| Yes | N/A | The iPaaS.com alternate IDs to resolve. |
Returns: List<string>. The product SKUs for the alternate IDs that could be resolved.
Example: GetAlternateIds(new List<string> { "abc123", "xyz789" }) returns the SKUs for the alternate IDs that match.
When to use it: When you need the product SKUs for a set of iPaaS.com alternate IDs during mapping.
ProductCategoryFromName
What it does: Looks up a Revel product category by name within an establishment and returns the matching category ID. Returns nothing if no category matches.
Signature: Task<long?> ProductCategoryFromName(string name, string establishment)
How to call it: await ProductCategoryFromName(name, establishment)
Parameter | Type | Required | Default | Description |
name |
| Yes | N/A | The product category name to look up in Revel. |
establishment |
| Yes | N/A | The Revel establishment the category belongs to, as an ID or a URI (a URI is converted to an ID automatically). |
Returns: long?. The Revel product category ID, or nothing if no category matches.
Example: await ProductCategoryFromName("Beverages", "/establishment/123/") returns the ID of the "Beverages" category in establishment 123.
When to use it: When mapping a product category name to its Revel category ID.
Payments
Use these to turn a Revel payment type ID into a readable description.
PaymentDescriptionFromPaymentType
What it does: Converts a Revel payment type ID into its payment description. Returns nothing if the ID is not recognized or not provided.
Signature: string PaymentDescriptionFromPaymentType(int? paymentType)
How to call it: PaymentDescriptionFromPaymentType(paymentType)
Parameter | Type | Required | Default | Description |
paymentType |
| Yes | N/A | The Revel payment type ID to describe. |
Returns: string. The payment description (for example "Credit"), or nothing if the ID is not recognized.
Example: PaymentDescriptionFromPaymentType(2) returns "Credit".
When to use it: When mapping a Revel payment type to its full description.
SimplifiedPaymentDescriptionFromPaymentType
What it does: Converts a Revel payment type ID into a simplified payment category, grouping the detailed types (for example the credit types become "CreditCard"). Returns nothing if the ID is not recognized or not provided.
Signature: string SimplifiedPaymentDescriptionFromPaymentType(int? paymentType)
How to call it: SimplifiedPaymentDescriptionFromPaymentType(paymentType)
Parameter | Type | Required | Default | Description |
paymentType |
| Yes | N/A | The Revel payment type ID to describe. |
Returns: string. The simplified payment category (for example "CreditCard", "Cash", or "Other"), or nothing if the ID is not recognized.
Example: SimplifiedPaymentDescriptionFromPaymentType(5) returns "CreditCard".
When to use it: When mapping a Revel payment type to a broad category for reporting or display.
Establishments, Employees, and Roles
Use these to resolve Revel establishment, role, and employee references during mapping.
GetEstablishmentIdFromSiteNumber
What it does: Looks up a Revel establishment by its site number and returns the establishment ID. Returns nothing if no establishment matches.
Signature: Task<long?> GetEstablishmentIdFromSiteNumber(string siteNumber)
How to call it: await GetEstablishmentIdFromSiteNumber(siteNumber)
Parameter | Type | Required | Default | Description |
siteNumber |
| Yes | N/A | The Revel establishment site number to look up. The match is exact. |
Returns: long?. The Revel establishment ID, or nothing if no establishment matches.
Example: await GetEstablishmentIdFromSiteNumber("1001") returns the ID of the establishment with site number 1001.
When to use it: When mapping an establishment by its site number to its Revel establishment ID.
RoleIdFromName
What it does: Looks up a Revel role by name and returns the role ID. The match is not case-sensitive. Returns nothing if no role matches.
Signature: Task<long?> RoleIdFromName(string roleName)
How to call it: await RoleIdFromName(roleName)
Parameter | Type | Required | Default | Description |
roleName |
| Yes | N/A | The Revel role name to look up. The match is not case-sensitive. |
Returns: long?. The Revel role ID, or nothing if no role matches.
Example: await RoleIdFromName("Admin") returns the ID of the "Admin" role.
When to use it: When mapping a role name to its Revel role ID.
EmployeePINFromId
What it does: Reads a Revel employee's PIN from the employee ID. Returns nothing if the employee is not found.
Signature: Task<string> EmployeePINFromId(string employeeId)
How to call it: await EmployeePINFromId(employeeId)
Parameter | Type | Required | Default | Description |
employeeId |
| Yes | N/A | The Revel employee ID or resource URI (for example |
Returns: string. The Revel employee's PIN, or nothing if the employee is not found.
Example: await EmployeePINFromId("/resources/Employee/1383/") returns the PIN of employee 1383.
When to use it: When mapping an employee reference and you need the employee's Revel PIN.
Utilities
General-purpose helpers you can use while building any Revel mapping.
ExtractIdFromUri
What it does: Extracts the numeric ID from the last segment of a URI. Returns nothing if the last segment is not a number.
Signature: int? ExtractIdFromUri(string resourceUri)
How to call it: ExtractIdFromUri(resourceUri)
Parameter | Type | Required | Default | Description |
resourceUri |
| Yes | N/A | The URI to read the ID from. A trailing slash is ignored and the ID is taken from the last segment (for example |
Returns: int?. The numeric ID from the last segment, or nothing if it is not a number.
Example: ExtractIdFromUri("/resources/product/789/") returns 789.
When to use it: When you have a Revel resource URI and need the numeric ID from its last segment.
ConvertToRevelDateTimeFormat
What it does: Formats a date/time value as the ISO 8601 string Revel expects, without milliseconds or a timezone offset. Returns nothing if the value is empty.
Signature: string ConvertToRevelDateTimeFormat(object input)
How to call it: ConvertToRevelDateTimeFormat(input)
Parameter | Type | Required | Default | Description |
input |
| Yes | N/A | The date/time value to format (a date/time value, or a string that can be parsed as one). |
Returns: string. The date/time formatted as yyyy-MM-ddTHH:mm:ss, or nothing if the value is empty.
Example: ConvertToRevelDateTimeFormat(input) returns a value such as "2025-04-08T14:23:45".
When to use it: When mapping a date/time value into a Revel field that requires the ISO 8601 format.
