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 / Joining two table and ...
Power Automate
Unanswered

Joining two table and content checking

(0) ShareShare
ReportReport
Posted on by 113

Hello Again!

This time I need a solution that will connect two tables, one from the SharePoint list and the other from Excel. They are connected by a subscription ID. I need this to insert this data into a previously created Excel file. Then I need a condition that will check whether a given field, in my case the value, is not empty during the loop connecting the data. I tried to do it with a loop within a loop but I didn't get the expected effect.

 

1.png

 

 

Categories:
I have the same question (0)
  • Matthy79 Profile Picture
    4,180 Super User 2024 Season 1 on at

    Hello @Sbsyx 


    You will have to create a simple array to use contains. Use the select action for that in text mode with the id value field.

  • Sbsyx Profile Picture
    113 on at

    Could you explain how to write it in select? In this text version, I mean referring to the contents of both files?

  • Matthy79 Profile Picture
    4,180 Super User 2024 Season 1 on at

    The select action is just to create a simple array of the second data source.

     

    Can you provide sample data of those 2 data sources and the desired output (please JSONs and no screenshots) and I will provide a solution how I would create it.

  • Sbsyx Profile Picture
    113 on at

    Thanks, 

    I created random data to present the situation because I do not have access to the original data. But the point is to combine data from two tables using a license:

    ID subscription (subscription.txt) = ID subscription Microsoft (sale.txt)

     

    JSON data is in *.txt files in the Data.zip archive.

  • Verified answer
    Matthy79 Profile Picture
    4,180 Super User 2024 Season 1 on at

    Hello @Sbsyx,

     

    Use the old designer to paste this code into a dummy flow (manually triggered) to see how it works.

     

    {"id":"9deb2881-86ce-4f41-8824-cede1c662020","brandColor":"#8C3900","connectionReferences":{"shared_sharepointonline":{"connection":{"id":"/providers/Microsoft.PowerApps/apis/shared_sharepointonline/connections/shared-sharepointonl-b959cb53-5ecb-4b41-805f-06e7795a0bd2"}},"shared_teams":{"connection":{"id":"/providers/Microsoft.PowerApps/apis/shared_teams/connections/da0f4068677c48aba01f0613c77dcb5b"}},"shared_conversionservice":{"connection":{"id":"/providers/Microsoft.PowerApps/apis/shared_conversionservice/connections/shared-conversionser-c02d19aa-75cf-44e4-b0f1-c36e677a6a16"}},"shared_commondataserviceforapps":{"connection":{"id":"/providers/Microsoft.PowerApps/apis/shared_commondataserviceforapps/connections/62947705b1a746319ca1e59aae985afc"}},"shared_office365users":{"connection":{"id":"/providers/Microsoft.PowerApps/apis/shared_office365users/connections/60ec96ba306e4804b12d17065506e219"}},"shared_office365groups":{"connection":{"id":"/providers/Microsoft.PowerApps/apis/shared_office365groups/connections/shared-office365grou-a1427af6-957f-485c-9c2a-98f30090bcf9"}}},"connectorDisplayName":"Control","icon":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHZlcnNpb249IjEuMSIgdmlld0JveD0iMCAwIDMyIDMyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPg0KIDxwYXRoIGQ9Im0wIDBoMzJ2MzJoLTMyeiIgZmlsbD0iIzhDMzkwMCIvPg0KIDxwYXRoIGQ9Im04IDEwaDE2djEyaC0xNnptMTUgMTF2LTEwaC0xNHYxMHptLTItOHY2aC0xMHYtNnptLTEgNXYtNGgtOHY0eiIgZmlsbD0iI2ZmZiIvPg0KPC9zdmc+DQo=","isTrigger":false,"operationName":"Scope_join_two_tables","operationDefinition":{"type":"Scope","actions":{"Compose_sale":{"type":"Compose","inputs":[{"contractor":"Jary","ID subscription Microsoft":"A789-98755-F5675","Sale":19.58,"subscription end":"9072-08-29"},{"contractor":"Ralfston","ID subscription Microsoft":"87C9-98755-F5675","Sale":1.04,"subscription end":"19630-09-02"},{"contractor":"Hedve","ID subscription Microsoft":"8789-98E55-F5675","Sale":5.56,"subscription end":"5037-08-28"},{"contractor":"Freddi","ID subscription Microsoft":"87W9-98755-F5675","Sale":10.23,"subscription end":"6851-04-09"},{"contractor":"Diann","ID subscription Microsoft":"878P-98755-F5675","Sale":3.52,"subscription end":"16159-03-05"}],"runAfter":{}},"Compose_subscription":{"type":"Compose","inputs":[{"Country":"Oman","ID subscription":"A789-98755-F5675","User number":646},{"Country":"Syrian Arab Republic","ID subscription":"87C9-98755-F5675","User number":220},{"Country":"Norway","ID subscription":"8789-98E55-F5675","User number":815},{"Country":"Tokelau","ID subscription":"87W9-98755-F5675","User number":574},{"Country":"Namibia","ID subscription":"878P-98755-F5675","User number":641},{"Country":"Antarctica","ID subscription":"8789-98755-F5675","User number":90},{"Country":"Cook Islands","ID subscription":"8789-9875O-F5675","User number":819},{"Country":"Western Sahara","ID subscription":"87Z9-98755-F5675","User number":949},{"Country":"Spain","ID subscription":"8789-9875Y-F5645","User number":558},{"Country":"Jamaica","ID subscription":"878Z-98755-F5675","User number":991}],"runAfter":{"Compose_sale":["Succeeded"]}},"Compose_subscription_xml":{"type":"Compose","inputs":"@xml(json(concat('{ \"root\": { \"array\": ', outputs('Compose_subscription'), '}}')))","runAfter":{"Compose_subscription":["Succeeded"]}},"Select_version1":{"type":"Select","inputs":{"from":"@outputs('Compose_sale')","select":{"contractor":"@item()['contractor']","ID":"@item()['ID subscription Microsoft']","Sale":"@item()['Sale']","subscription end":"@item()['subscription end']","Country":"@first(xpath(outputs('Compose_subscription_xml'), concat('root/array[ID_x0020_subscription=\"', item()['ID subscription Microsoft'], '\"]/Country/text()')))","User number":"@float(first(xpath(outputs('Compose_subscription_xml'), concat('root/array[ID_x0020_subscription=\"', item()['ID subscription Microsoft'], '\"]/User_x0020_number/text()'))))"}},"runAfter":{"Compose_subscription_xml":["Succeeded"]}},"Select_version2":{"type":"Select","inputs":{"from":"@outputs('Compose_sale')","select":{"Sale":"@item()","Subscription":"@json(first(xpath(outputs('Compose_subscription_xml'), concat('root/array[ID_x0020_subscription=\"', item()['ID subscription Microsoft'], '\"]'))))['array']"}},"runAfter":{"Select_version1":["Succeeded"]}},"Select_version3":{"type":"Select","inputs":{"from":"@outputs('Compose_sale')","select":"@addProperty(item(), 'Subscription', json(first(xpath(outputs('Compose_subscription_xml'), concat('root/array[ID_x0020_subscription=\"', item()['ID subscription Microsoft'], '\"]'))))['array'])"},"runAfter":{"Select_version2":["Succeeded"]}}},"runAfter":{}}}

    Matthy79_0-1703871407765.png

    You will have to press "Ctrl+v" if you are on the "My clipboard"-page.

     

    I created 3 versions. Choose the one you like the most.

    version1 has more code but also the conversion back to a number included.

    version2 and 3 are almost the same but have a different layout. They use less code and will work the same even if you are joining more columns.

  • Sbsyx Profile Picture
    113 on at

    Thank you,

    I will check it tomorrow and mark the solution

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 425 Moderator

#3
abm abm Profile Picture

abm abm 245 Most Valuable Professional

Last 30 days Overall leaderboard