[dynamic_help_sidebar root="leads"]

TCP Trigger and TCP Action in UDS

1. Feature Overview

Universal Data Sync (UDS) now supports TCP (Transmission Control Protocol) as both a Trigger and an Action. This allows LeadSquared to integrate with healthcare and legacy systems that rely on socket-based communication instead of REST/HTTPS APIs.

With TCP support, UDS workflows can:

  • Receive inbound HL7 messages over TCP and trigger workflows in real time
  • Send outbound HL7 messages to external systems using TCP or MLLP

This capability is primarily intended for healthcare integrations and legacy platforms where message accuracy, ordering, and reliability are mandatory.

 

2. Use Cases

Receive Healthcare Data

  • Accept inbound HL7 messages from EHR/EMR systems
  • Trigger workflows for patient registration, updates, and appointment events

Send Data to Healthcare Systems

  • Push ADT and appointment-related HL7 messages to partner systems
  • Support outbound integrations with hospitals and healthcare platforms

Integrate with Legacy Systems

  • Connect to systems that do not expose REST APIs
  • Enable socket-based communication using TCP or MLLP

 

3. Key Technical Concepts

Term

Description

TCP

Reliable, bidirectional protocol that ensures ordered and complete data delivery

HL7

Health Level Seven – standard for exchanging healthcare data

ADT

Admission, Discharge, Transfer events

SIU

Scheduling Information Unsolicited events

MLLP

HL7-specific wrapper used to safely transmit messages over TCP

Supported HL7 Message Types

ADT Events

  • ADT-A04 – Patient creation / registration
  • ADT-A08 – Patient information update

SIU Events

  • SIU-S12 – New appointment booking
  • SIU-S14 – Appointment modification
  • SIU-S15 – Appointment cancellation

 

4. Configure TCP Trigger

A TCP Trigger starts a workflow when HL7 data is received over a TCP connection.

Step 1: Trigger Selection

  • Request Data Format: HL7 (pre-selected)
  • Connection Type:
    • TCP
    • MLLP (recommended for HL7)
  • Message Type: Select the relevant ADT or SIU event

Sample HL7 Payload

Provide a sample HL7 message from the source system or send a test message. This sample is used to identify segments and enable variable mapping.

MSH|^~\\&|HIS|Hospital|LSQ|LeadSquared|202401011230||ADT^A04|MSG00001|P|2.3
EVN|A04|202401011230
PID|1||12345^^^Hospital||Doe^John||19800101|M|||123 Main St^^City^State^12345||9876543210
NK1|1|Doe^Jane|SPOUSE|9876543211

Step 2: Configuration

After saving the trigger, UDS generates:

  • Host (IP Address)
  • Port Number
  • App ID
  • Flow ID

Configure the external system to send HL7 messages to the provided host and port.

Note: All TCP triggers within a tenant share the same host and IP. App ID and Flow ID help identify the target workflow.

Configure TCP Trigger

 

5. Configure TCP Action

Variable Mapping

  • Variables extracted from the TCP trigger or previous actions can be inserted into the HL7 request body
  • Users should map values based on HL7 segment definitions (PID, EVN, MSH, etc.)

Configuration Details

Provide the following information:

  • Destination Host / IP Address
  • Port Number
  • Protocol Type: TCP or MLLP
  • Data Transmission Type: HL7
  • Message Type: ADT or SIU event
  • Request Body: HL7 message (supports variables)

configure tcp action

 

6. Logs

Execution logs are available for monitoring and troubleshooting.

TCP IP logger uds

 

FAQs

Is TCP supported for non-healthcare use cases?

TCP support is designed primarily for healthcare and legacy systems. Non-healthcare use cases are supported only if the external system uses HL7 over TCP.

Can I send or receive JSON data over TCP?

No. Currently, only HL7 data format is supported for TCP triggers and actions.

What is the difference between TCP Trigger and Webhooks?

Webhooks use HTTPS endpoints, while TCP Triggers rely on socket-based communication using IP and port. TCP is commonly required by legacy and healthcare systems.

Should I use TCP or MLLP?

MLLP is recommended for HL7 communication as it safely wraps messages over TCP.

Are UI changes expected for TCP workflows?

Yes. UI improvements for TCP configuration are ongoing and may change in future releases.

 

Any Questions?

Did you find this article helpful? Please let us know any feedback you may have in the comments section below. We’d love to hear from you and help you out!

UDS Integration Assistant

1. Feature Overview

The UDS AI Assistant helps you configure flows, debug failed executions, and generate transformation logic — directly within the UDS interface. Instead of manually analyzing error logs or writing LiquidJS expressions from scratch, you can use the assistant to get explanations, suggested fixes, and ready-to-use code.

The assistant supports three primary use cases:

  • Debugging failed logs — Analyze why a flow execution failed and get recommendations for next steps.
  • Generating transformation logic — Describe your input and desired output, and the assistant returns the corresponding LiquidJS expression.
  • General configuration help — Ask questions about how to set up or manage flows in UDS.

 

2. Prerequisites

  • You must be an Administrator user, or access must be shared to you by an Admin user
  • The Universal Data Sync Connector is a paid feature. To enable it on your account, contact your account manager, or write to support@leadsquared.com.

 

3. Accessing the AI Assistant

You can open the AI Assistant from anywhere within UDS using the Ask AI button in the interface. This gives you a chat window where you can ask general configuration or transformation-related questions.

Ask AI button

When working inside a specific app’s logs, you also have a Debug with AI option on individual log entries. This passes the relevant request ID and error details directly to the assistant for analysis.

debug with AI

 

4. Debugging Logs with AI

When a flow execution fails, UDS records the error details in the app’s execution logs. In some cases, the error message is self-explanatory (for example, “Field value cannot be more than 200 characters in length”). In other cases, the log may show a generic failure with no clear cause, such as an empty response from a third-party API.

The Debug with AI feature helps in both scenarios — it interprets the error, explains the likely cause, and suggests corrective steps.

How to Debug a Failed Log Entry

  1. Open the UDS app whose logs you want to review.
  2. Navigate to the Logs section.
  3. Locate the failed log entry.
  4. Click Debug with AI.

The assistant receives the request ID and associated error details for that log entry. It then analyzes the failure and returns an explanation in the chat panel.

What the Assistant Returns

Depending on the error, the assistant provides:

  • A plain-language explanation of why the execution failed.
  • The likely root cause (for example, a connection timeout, an invalid field value, or a missing required parameter).
  • Suggested next steps to resolve the issue.

If the initial summary is not detailed enough, you can ask follow-up questions in the chat to get more specific guidance.

Note: The assistant may take a few moments to return a response, depending on the complexity of the log entry.

debugging logs with uds integration assistant

 

5. Generating Transformation Logic

When mapping data between systems, you may need to transform values into a format that the receiving API accepts. UDS uses LiquidJS for custom transformation logic (see Transformations in UDS for details).

Instead of writing LiquidJS expressions manually, you can describe what you need to the AI Assistant and it will generate the logic for you.

How to Generate a Transformation

  1. Open the AI Assistant from anywhere in UDS.
  2. Describe your transformation requirement. Include:
    • The input format (what the current value looks like).
    • The desired output format (what the receiving system expects).
  3. The assistant returns the LiquidJS expression.
  4. Copy the expression and paste it into the transformation field for your mapped variable.

Example

You receive a phone number from an API in the format +91-9876543210, but the downstream API requires the format 91(98765)-43210.

You can describe this to the assistant:

“The input phone number is in the format +91-9876543210. I need the output in the format 91(98765)-43210. Can you give me the transformation logic?”

The assistant returns the corresponding LiquidJS expression, which you can copy and apply in the transformation configuration for that field.

 

FAQs

1. Where can I access the AI Assistant?

The assistant is available from anywhere within the UDS interface. For log debugging specifically, you can also use the Debug with AI option on individual log entries.

2. Can the assistant fix errors automatically?

No. The assistant provides analysis and suggestions. You need to apply the recommended changes to your flow configuration or transformation logic manually.

3. What if the assistant’s response is unclear or incomplete?

You can ask follow-up questions in the same chat session to get more details or clarification.

4. Does the Debug with AI feature work for all log entries?

It works on failed log entries where a request ID is available. The assistant uses the request ID and error context to analyze the failure.

5. How should I phrase my transformation request to get accurate results?

Be specific about both the input and output formats, and include example values where possible. For instance, instead of asking “convert my phone number,” specify the exact formats: “The input is +91-9876543210 and I need the output as 91(98765)-43210.”

6. Should I test the generated transformation logic before applying it?

Yes. Use the transformation preview in UDS (if available) or an online LiquidJS playground to verify that the expression produces the expected output before saving it to your flow.

 

Any Questions?

Did you find this article helpful? Please let us know any feedback you may have in the comments section below. We’d love to hear from you and help you out!

Combining Query Results Using Union in Analytics Report Builder

1. Feature Overview

The Union and Union All options in the Analytics Report Builder allow you to combine the results of two or more queries into a single dataset by stacking rows vertically.

Unlike Joins, which merge related tables side-by-side (column-wise), Union combines datasets that share the same structure and appends them together (row-wise).

Union is useful when you want to consolidate similar data from multiple sources into one unified report.

 

2. Prerequisites

 

3. When to Use Union

Use Union when you want to:

  • Merge similar datasets into one report
  • Combine data from parallel entities (e.g., Leads and Activities)
  • Create unified workload or engagement reports
  • Append filtered query results together
  • Avoid relational joins where no direct relationship is required

3.1 Union vs Union All

Option

Behavior

Union

  • Combines datasets and removes duplicate rows.
  • Use Union when you want automatic deduplication.

Union All

  • Combines datasets and retains all rows, including duplicates.
  • Use Union All when every record must be counted (recommended for volume-based reports).

3.2 Important Rules for Using Union

Union can only be applied between queries, not base tables.

Before applying Union, ensure:

  • Both queries return the same number of columns
  • Columns appear in the same order
  • Corresponding columns use compatible data types
  • Business meaning of each column matches across queries

If these conditions are not met, Analytics will show a validation error when saving the report.

 

4. Union Configuration

4.1 Use Case

For example, let’s say you want to combine Lead Source information from:

  • Leads table
  • Activities table

The goal is to create a single dataset that shows all sources (from both Leads and Activities) in one report. This combines Lead Source at the lead level with Traffic Source from activities (for example, form submissions or other interactions), so both the lead’s origin and activity-driven sources are included in one dataset—allowing you to see where the lead originally came from and how the lead interacted later.

Step 1: Create Query 1 (Leads)

  1. Click + New Query
  2. Select Leads as the data source
  3. Add the following rows:
    • Lead Source
    • Prospect ID
  4. Apply required filters, such as Created On (date range)
  5. Save the query

Step 2: Create Query 2 (Activities)

  1. Click + New Query
  2. Select All Activities as the data source
  3. Add the following rows in the same order as Query 1:
    • Traffic Source
    • Related Prospect ID
  4. Apply filters such as:
    • Activity Event
    • Created On (date range)
  5. Save the query

Step 3: Apply Union

  1. In the Data Source section, Under Combine Tables, select Union or Union All
  2. Choose:
    • Query 1 (Leads)
    • Query 2 (Activities)

If both queries follow the validation rules, the union will execute successfully and combine the datasets into a single result.

creating a union in analytics

4.2 Showing Query Filters in the Main Report

You can control query-level filters from the main report page:

  1. Edit the query
  2. Go to Filters
  3. Click the three-dot menu on a filter
  4. Enable Show this filter in the main report page

This allows centralised filtering after union is applied. You

Note: User filters cannot be exposed.

query filters in the main report

 

FAQs

1. Can I use Union directly on tables?

No. Union works only between queries.

2. What happens if column data types do not match?

The report will fail validation and show an error.

3. Which column names appear in the final report?

Column display names are inherited from the left-hand (primary) query.

 

Any Questions?

We’d love to hear your feedback to help improve this article. Feel free to enter your questions or in the comments section below.

Bot Filtering of Email Engagement Activities

1. Feature Overview

Email engagement metrics like opens and clicks help measure campaign performance, and additionally trigger marketing workflows in your organization. However, some of these interactions may be generated by automated systems rather than real recipients. Bot Filtering automatically excludes suspected bot-generated email activities from your campaign reports, ensuring more accurate engagement metrics.

 

2. Why Use Bot Filtering

Certain privacy and security systems automatically scan incoming emails and links. This can result in artificial opens or clicks being recorded. Common sources of such automated activity include Apple Mail Privacy Protection, Mimecast and other corporate email security filters. These automated interactions can inflate open and click rates, trigger workflows unintentionally, skew campaign performance analysis and impact marketing decisions. Bot Filtering helps eliminate this by excluding suspected bot activity from your email campaign reports.

 

3. Prerequisites

This feature is not available by default. Reach out to support@leadsquared.com to get this enabled.

 

4. How It Works

Once Bot Filtering is enabled –

  1. Navigate to Marketing>Email Campaign.
  2. Click the Actions icon alongside the relevant campaign and select View Report.

A message will appear at the top of the report – Bot Filtering Enabled: This excludes bot-generated activities, allowing you to generate accurate metrics based on genuine user interactions.

All email performance metrics in the report will automatically exclude suspected bot-generated opens and clicks. Bot engagements are also filtered from all Email Reports in the Reports page, Automation Email Reports and Activity History tab on the Lead Details page.

Leadsquared - Bot Filtering

 

Any Questions?

Did you find this article helpful? Please let us know any feedback you may have in the comments section below. We’d love to hear from you and help you out!