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

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / I need to do a lookup ...
Power Automate
Unanswered

I need to do a lookup in Flow. Not sure how to write it.

(0) ShareShare
ReportReport
Posted on by 3,340

The value for SolidworksStatus needs to come from another table keyed on PartNumber.  Its an SQL View with the column name "Status".  Any idea how to do this?

 

In powerapps it would read:

 

Lookup(SQL_Table, PartNumber=Part_Number, Status)

 

Thank you.

 

image.png

Categories:
I have the same question (0)
  • leyburn19 Profile Picture
    2,157 on at

    In flow you would need to to a "get items" action and use the filter like PartNumber eq 'Part_Number'

     

    Then initialise a string variable - call it something like varPN

     

    The set variable varPN to be the Status field.  It will do an apply to each,  but as you have done a filter it will only find the one result

     

    Then put the varPN in the select statement

     

  • martinav Profile Picture
    3,340 on at

    @leyburn19 ,

     

    Thanks for the reply.  The create table action only works with a single "Apply to All" situation.  That is why I need a lookup style of command.  

  • leyburn19 Profile Picture
    2,157 on at

    I do this a lot.  I have two tables (Lists - as they are sharepoint).  One contains a list of our 29 Stores,  the other contains a list of orders at each store.  I want to show all open orders but by store in my result.

     

    I do a 'get items' action on the store list to return all the stores.

     

    I then do a 'get items' action  on the order list and in the filter I put:

    CurrentliststorelinkID eq 'StoreListLinkID'  and STATUS eq 'Open' 

    (The first is name of the field that would match the store list and the second comes from the Dynamic Content.  The last part is a known filter status)

     

    I then do a 'select' action rather than create HTML and use the result of the select for the create HTML table.  I base the value of the select (like your HTML) to be the value of the Stores List get Items from Dynamic content

     

    I do one last thing - a compose action with a replace statement.  This puts code into the HTML result to give my table and cells a border

     

    This loops through all the stores and creates a list based on the particular store only.

     

    I then email the result each time so I see it in a table in the email,  which can be cut and paste into excel if wanted.  You could also put the result into an excel table on your onedrive,  but I found this problematic

     

     

  • Blank Profile Picture
    6 on at

    Hey @leyburn19 

     

    I follow you up to here:

    "I then do a 'select' action rather than create HTML and use the result of the select for the create HTML table.  I base the value of the select (like your HTML) to be the value of the Stores List get Items from Dynamic content

     

    I do one last thing - a compose action with a replace statement.  This puts code into the HTML result to give my table and cells a border"

     

    - Could you provide some context or examples for how you use the result and potentially a sample of the the Compose action?

     

    Thanks!

     

  • leyburn19 Profile Picture
    2,157 on at

    Not sure if this is what you need but some pictures below.  The expression in the last compose in 

     

    replace(body('Create_HTML_table'),'<table>','<table border="1" padding="5">')
     
    This takes the html table and gives it lines in the outpout
     
    Image1.PNG
    image 2.PNG
     
    Image 3.PNG

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
trice602 Profile Picture

trice602 224 Super User 2026 Season 1

#2
David_MA Profile Picture

David_MA 181 Super User 2026 Season 1

#3
Kalathiya Profile Picture

Kalathiya 97 Super User 2026 Season 1

Last 30 days Overall leaderboard