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

Notifications

Announcements

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard