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 / Extract value from one...
Power Automate
Unanswered

Extract value from one table if their values match the 2nd table

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

**Background:**

I have two tables within a CosmosDB database that hold key:value documents within their containers.
T1 and T2


T1

Id: 111
ems_featurecategory: 1234
ems_name: "win"

 

T2

feature_category: "win"
feature_category: "hello"

 

I wish to query cosmosdb so that I:

Return the value from T1 ems_featurecategory key if the ems_name value from T1 matches the feature_category value from T2.

 

**Desired Output:**

So since the ems_name key's value from T1 matches the featurecategory's key's value from T2

ems_name: "win"
featurecategory: "win",

the value that will be returned will be: 1234

 

 

**My approach:**

JOIN the two tables and perform a query such as:

SELECT c.emsfeaturecategory, c.ems_name, f.feature_category
FROM c
JOIN f in c.id
WHERE array_contains(['',''],c.id,true)
AND c.ems_name = featurecategory...

 

I am not sure how to write this query out successfully. Any suggestions or advice is helpful.

 

 

Categories:
I have the same question (0)
  • JohnAageAnderse Profile Picture
    1,986 on at

    Hello @jasmine2020 

    Not really related to Power Automate 🙂 but here goes - I would use an INNER JOIN to get records from T1 which are found in T2 - like this:

    SELECT T1.ems_featurecategory, T1.ems_name, T2.feature_category
    FROM T1
    INNER JOIN T2 ON T1.ems_name = T2.feature_category

    Kind regards, John

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!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 77 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 68

#3
Expiscornovus Profile Picture

Expiscornovus 56 Most Valuable Professional

Last 30 days Overall leaderboard