The general idea is to get a json array from both tables (I called them Table0 and Table1), each with only the comparable values (Step 1 to 4).
Then check if array1 contains a certain json from array0 (Step 5)
I don't know a way to add a column to a table, that's why I create a new table (Step 6)
Then iterate over the values from the Select that has the status (Step 8 )
and add a new row with all columns from Table0 (Step 9-10, that's why you need the index variable) and the status.
- List rows present in Table0
- Select action to extract common columns from Table0
- List rows present in Table1
- Select action to extract common columns from Table1
- Select action with input from Step 2 and the new mapping "status" to contains(body('Select_Table1'), item())
- Create a new table in Excel with all columns from Table 0 plus an extra column "status"
- initialize variable "index" with 0
- Apply to each with input body('Select_Table0_status')
- Add a row to the new table
- Increment index
This is what the row in Step 9 looks like:
{
"customer name": @{outputs('List_rows_present_in_a_table_Table0')?['body/value']?[variables('index')]?['customer name']},
"product name": @{outputs('List_rows_present_in_a_table_Table0')?['body/value']?[variables('index')]?['product name']},
... all the columns of your original Table0 in correct order...
"status": @{item()?['status']}
}
The flow:


My to input tables:


Result:
