> ## Documentation Index
> Fetch the complete documentation index at: https://help.peliqan.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Peliqan and Power Automate

You can use Microsoft Power Automate in combination with Peliqan, for example to build automations that use data from the Peliqan data warehouse.

<Note>
  Note that we use the “New designer” in Power Automate. See the toggle in the top right corner in the Power Automate flow designer.
</Note>

# Example 1: read data from the Peliqan data warehouse, evaluate and send alerts to MS Teams

In the below example we build a Flow in Power Automate that runs on a schedule. The flow fetches data from a view (or table) in the Peliqan data warehouse. It loops over the rows and checks the value for one column. If the value is higher than a treshold, an alert is sent to Microsoft Teams.

In the example below we monitor a table with invoices and if the invoice amount (invoice\_total) is higher than 100.000, we send out the alert.

### Step 1: add a connection in Power Automate to the Peliqan data warehouse

In Power Automate, go to Connections, add a Postgres connection and add the details of your Peliqan data warehouse. You can find all details in Peliqan under “Connections”, see the Connection Card for the Peliqan data warehouse.

<img src="https://mintcdn.com/peliqan-9d7f0393/n7mbWWerGRtqvdxO/images/Connect%20your%20BI,%20DB%20tool%20or%20iPaaS/Peliqan%20and%20MS%20Power%20Automate/power_automate_postgres_connection.png?fit=max&auto=format&n=n7mbWWerGRtqvdxO&q=85&s=8d105a910b1574d64a47df3dd30faf14" alt="power automate postgres connection.png" width="3080" height="1800" data-path="images/Connect your BI, DB tool or iPaaS/Peliqan and MS Power Automate/power_automate_postgres_connection.png" />

### Step 2: Create a scheduled flow

Create a scheduled flow in Power Automate:

<img src="https://mintcdn.com/peliqan-9d7f0393/n7mbWWerGRtqvdxO/images/Connect%20your%20BI,%20DB%20tool%20or%20iPaaS/Peliqan%20and%20MS%20Power%20Automate/power_automate_scheduled_flow.png?fit=max&auto=format&n=n7mbWWerGRtqvdxO&q=85&s=2107b2433637a95ef80e641bde1a36ce" alt="power automate scheduled flow.png" width="1792" height="1128" data-path="images/Connect your BI, DB tool or iPaaS/Peliqan and MS Power Automate/power_automate_scheduled_flow.png" />

### Step 3: Get rows from a table or view (query) in Peliqan

In the flow, add a block “Get Rows” and choose a table or view from the Peliqan data warehouse. In the exampe below we have selected [chargebee.top](http://chargebee.top)\_invoices:

<img src="https://mintcdn.com/peliqan-9d7f0393/n7mbWWerGRtqvdxO/images/Connect%20your%20BI,%20DB%20tool%20or%20iPaaS/Peliqan%20and%20MS%20Power%20Automate/power_automate_get_rows.png?fit=max&auto=format&n=n7mbWWerGRtqvdxO&q=85&s=b27753708b37dee179c375f581feb3b8" alt="power automate get rows.png" width="3088" height="1806" data-path="images/Connect your BI, DB tool or iPaaS/Peliqan and MS Power Automate/power_automate_get_rows.png" />

### Step 4: Loop over the rows

Add a block “Apply to each”. Select the output from the previous step “Get rows”:

<img src="https://mintcdn.com/peliqan-9d7f0393/n7mbWWerGRtqvdxO/images/Connect%20your%20BI,%20DB%20tool%20or%20iPaaS/Peliqan%20and%20MS%20Power%20Automate/power_automate_for_each.png?fit=max&auto=format&n=n7mbWWerGRtqvdxO&q=85&s=f69c7696963fde82797018ac5ccc8185" alt="power automate for each.png" width="1802" height="764" data-path="images/Connect your BI, DB tool or iPaaS/Peliqan and MS Power Automate/power_automate_for_each.png" />

### Step 5: Use a condition to check a value for one row

Inside the loop, add a Condition block, and add an expression that references one value from the item in the loop. In the example below we reference invoice\_total from each row, with the expression:

`decimal(items('Apply_to_each')?['invoice_total'])`

<img src="https://mintcdn.com/peliqan-9d7f0393/n7mbWWerGRtqvdxO/images/Connect%20your%20BI,%20DB%20tool%20or%20iPaaS/Peliqan%20and%20MS%20Power%20Automate/power_automate_condition_expression.png?fit=max&auto=format&n=n7mbWWerGRtqvdxO&q=85&s=1fcc7517fea1fc85e5344c9aa56f3948" alt="power automate condition expression.png" width="1514" height="898" data-path="images/Connect your BI, DB tool or iPaaS/Peliqan and MS Power Automate/power_automate_condition_expression.png" />

Add a condition, e.g. “is greater than” and value 100.000:

<img src="https://mintcdn.com/peliqan-9d7f0393/n7mbWWerGRtqvdxO/images/Connect%20your%20BI,%20DB%20tool%20or%20iPaaS/Peliqan%20and%20MS%20Power%20Automate/power_automate_condition_expression_2.png?fit=max&auto=format&n=n7mbWWerGRtqvdxO&q=85&s=d222a2fe2b1ef58d8c71eccd7f0fee92" alt="power automate condition expression 2.png" width="2678" height="922" data-path="images/Connect your BI, DB tool or iPaaS/Peliqan and MS Power Automate/power_automate_condition_expression_2.png" />

### Step 6: Send an alert to MS Teams if the value > 100.000

Add a block “Post message in a chat or channel”:

<img src="https://mintcdn.com/peliqan-9d7f0393/n7mbWWerGRtqvdxO/images/Connect%20your%20BI,%20DB%20tool%20or%20iPaaS/Peliqan%20and%20MS%20Power%20Automate/power_automate_send_teams_message.png?fit=max&auto=format&n=n7mbWWerGRtqvdxO&q=85&s=8eb12d36385d5dd1117f88283dead494" alt="power automate send teams message.png" width="2666" height="1340" data-path="images/Connect your BI, DB tool or iPaaS/Peliqan and MS Power Automate/power_automate_send_teams_message.png" />

# Example 2: send data from Peliqan to an Excel file on Sharepoint

### Step 1: Add a table to Excel

Create an Excel file on Sharepoint and add a Table on a sheet. Select a region on a sheet, then go to Insert > Table.

### Step 2: Make the table empty

In the flow in Power Automate, we first make the table empty, so that in subsequent runs of our flow, we do not keep adding the same rows to our table.

Do this by adding following blocks:

* List rows present in a table (Excel)
* Apply to each: output from previous step is body/value from the list of rows, example expression: `outputs('List_rows_present_in_a_table')?['body/value']`
* Inside the loop: add block “Delete a row” (Excel)

<img src="https://mintcdn.com/peliqan-9d7f0393/n7mbWWerGRtqvdxO/images/Connect%20your%20BI,%20DB%20tool%20or%20iPaaS/Peliqan%20and%20MS%20Power%20Automate/Screenshot_2025-12-06_at_22.06.21.png?fit=max&auto=format&n=n7mbWWerGRtqvdxO&q=85&s=da4485a3260f9e10e5f7d42adfe2b025" alt="Screenshot 2025-12-06 at 22.06.21.png" width="1952" height="1778" data-path="images/Connect your BI, DB tool or iPaaS/Peliqan and MS Power Automate/Screenshot_2025-12-06_at_22.06.21.png" />

Settings for the block “Delete a row”:

<img src="https://mintcdn.com/peliqan-9d7f0393/n7mbWWerGRtqvdxO/images/Connect%20your%20BI,%20DB%20tool%20or%20iPaaS/Peliqan%20and%20MS%20Power%20Automate/Screenshot_2025-12-06_at_22.10.29.png?fit=max&auto=format&n=n7mbWWerGRtqvdxO&q=85&s=520292709aadfffe6790a3c647e6f70a" alt="Screenshot 2025-12-06 at 22.10.29.png" width="1842" height="1062" data-path="images/Connect your BI, DB tool or iPaaS/Peliqan and MS Power Automate/Screenshot_2025-12-06_at_22.10.29.png" />

### Step 3: add rows from Peliqan to Excel

Now we can read the data from Peliqan and add rows to Excel. Add following blocks in the flow in Power Automate:

* Get rows (Postgres, see above on how to add a connection to the Peliqan data warehouse)
* Apply to each
* Inside the loop: Add a row into a table (Excel)

In the block “Get rows”, select a table or view from the Peliqan data warehouse:

<img src="https://mintcdn.com/peliqan-9d7f0393/n7mbWWerGRtqvdxO/images/Connect%20your%20BI,%20DB%20tool%20or%20iPaaS/Peliqan%20and%20MS%20Power%20Automate/Screenshot_2025-12-06_at_22.13.05.png?fit=max&auto=format&n=n7mbWWerGRtqvdxO&q=85&s=71b3013ca9a70865fe2e3bf97c830744" alt="Screenshot 2025-12-06 at 22.13.05.png" width="1780" height="698" data-path="images/Connect your BI, DB tool or iPaaS/Peliqan and MS Power Automate/Screenshot_2025-12-06_at_22.13.05.png" />

Note: under Settings, allow the flow to continue, even if the previous block (delete row) failed. This can happen e.g. for empty rows in the table, they don’t have a unique value for the first column and cannot be deleted by Power Automate.

<img src="https://mintcdn.com/peliqan-9d7f0393/n7mbWWerGRtqvdxO/images/Connect%20your%20BI,%20DB%20tool%20or%20iPaaS/Peliqan%20and%20MS%20Power%20Automate/Screenshot_2025-12-06_at_22.13.14.png?fit=max&auto=format&n=n7mbWWerGRtqvdxO&q=85&s=f7d52d2f9c32ac0016017b58348e0db2" alt="Screenshot 2025-12-06 at 22.13.14.png" width="1248" height="1128" data-path="images/Connect your BI, DB tool or iPaaS/Peliqan and MS Power Automate/Screenshot_2025-12-06_at_22.13.14.png" />

In the block “Add a row into a table”, reference the same Excel file and table as above, and map values from the row from Postgres, to columns in the table:

<img src="https://mintcdn.com/peliqan-9d7f0393/n7mbWWerGRtqvdxO/images/Connect%20your%20BI,%20DB%20tool%20or%20iPaaS/Peliqan%20and%20MS%20Power%20Automate/Screenshot_2025-12-06_at_22.15.11.png?fit=max&auto=format&n=n7mbWWerGRtqvdxO&q=85&s=24e8fc536365c310d68c91662152f071" alt="Screenshot 2025-12-06 at 22.15.11.png" width="1842" height="1430" data-path="images/Connect your BI, DB tool or iPaaS/Peliqan and MS Power Automate/Screenshot_2025-12-06_at_22.15.11.png" />


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.