web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How can I merge two ta...
Power Automate
Suggested Answer

How can I merge two tables?

(1) ShareShare
ReportReport
Posted on by 565
Hi there,
 
How can I reproduce this functionality in Power Automate?
I need to create a schedule flow that send the collection colMinStockReport in an html table by email. 
 
ClearCollect(colMinStock,ShowColumns(Filter(Inventory_Catalogs , MinimumStock > 0),Name,CatalogID,MinimumStock) );
ClearCollect(colAssetsStockNew, Filter(Inventory_Assets, (AssetStatus = varAssetStatusNew Or AssetStatus=varAssetStatusUsed) And !IsBlank(CatalogID) ));
 
ClearCollect(
    colMinStockReport,
    AddColumns(
        colMinStock As COUNT,
        Quantity,
        CountIf(colAssetsStockNew, CatalogID= COUNT.CatalogID )
    )
);
 
Thanks in advance!
Categories:
I have the same question (0)
  • Michael E. Gernaey Profile Picture
    53,958 Moderator on at
     
    Please do not ask us to write your work totally for you, we :-( are free helpers thats it.
     
    Also, you don't specify is this thing supposed to run all the time, is it scheduled, do you want to pass the data from the App to the Flow
     
    What exactly do you want to do?
     
    Why not just pass the data from the App to where you want, you can use the Connectors there to do it.
  • EmilioRoqueta69 Profile Picture
    565 on at
    Hi, It has to be a schedule flow.
     
    I only want to know how to do this merge in Power Automate:
     
    ClearCollect(
        colMinStockReport,
        AddColumns(
            colMinStock As COUNT,
            Quantity,
            CountIf(colAssetsStockNew, CatalogID= COUNT.CatalogID )
        )
    );
     
    Just an example or join 2 tables, not the full code, I never saw an example of this.
    Thanks in advance!
  • Suggested answer
    Riyaz_riz11 Profile Picture
    4,150 Super User 2026 Season 1 on at
    Hi,

     1. Power Automate Setup
     Flow Trigger:
    Trigger: PowerApps
     Add Parameters:
    Use the "Ask in PowerApps" option to add two parameters:
    colMinStock (Array)
    colAssetsStockNew (Array)
    These should be Power Apps collections serialized as JSON.
     2. Process Collections in Power Automate
     Initialize Variables:
    varMinStock → type: Array, value: colMinStock
    varAssetsStockNew → type: Array, value: colAssetsStockNew
    varMinStockReport → type: Array, value: []
     Apply to Each: Loop over varMinStock
    Inside the loop:
    Current Item: currentCatalog
     Step A: Filter colAssetsStockNew
    Use a Filter array:
    From: varAssetsStockNew
    Condition: item()['CatalogID'] = items('Apply_to_each')?['CatalogID']
     Step B: Count Matches
    Use a Compose action:

    length(body('Filter_array'))
     Step C: Append to Report Array
    Use Append to array variable varMinStockReport:
    {
      "CatalogID": "@{items('Apply_to_each')?['CatalogID']}",
      "Name": "@{items('Apply_to_each')?['Name']}",
      "MinimumStock": "@{items('Apply_to_each')?['MinimumStock']}",
      "Quantity": "@{outputs('Compose')}"
    }
     3. Create HTML Table
    Action: Create HTML Table
    From: varMinStockReport
    Columns: Automatic or Custom
     4. Send Email
    To: you@domain.com
    Subject: Min Stock Report
    Body:
    <h2>Minimum Stock Report</h2>
    @{outputs('Create_HTML_table')}

     
    If I have answered your question, please mark it as the preferred solution ✅ . If you like my response, please give it a Thumbs Up 👍.
    Regards,
    Riyaz

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 997

#2
Valantis Profile Picture

Valantis 810

#3
Haque Profile Picture

Haque 642

Last 30 days Overall leaderboard