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 / Look up in array, base...
Power Automate
Unanswered

Look up in array, based off CurrentItem, and get data

(0) ShareShare
ReportReport
Posted on by 152

Hello everyone,

 

I'm trying to build a flow, and I've reached a point where I know what I want, I just don't know how to produce it, and I cant seem to find anything on it.

I currently have 2 arrays, where in Array X, I have some data, and one of these is a Code, like "PR10203040", and in Array Y I have the same "PR10203040", and some other data, most importantly, a more nice-to-read name, that I want. 

I'm trying to add data from both arrays to an email, and send it, but I'm stuck on this; 

How do I make a lookup on Array Y, based on the current items PR code? Like, if it has PR102030, how do I make it look up in array Y for PR102030, and use that data 

If you need any more information, please ask 🙂 

Categories:
  • Chriddle Profile Picture
    8,729 Super User 2026 Season 2 on at

    If you have few elements in your Array X, you can filter Array Y for each code from Array X.

    However, this takes a while for large arrays, and in that case you should convert Array Y to XML and use XPATH to find the names. This can be done within a select action for the entire Array X.

  • MortenBak Profile Picture
    152 on at

    Hello Chriddle,

     

    I'm not sure what you mean. 

    If I try explaning what I want the end result to be;
    I have the email, being sent out to a user, and instead of it saying PR123321, I want the PR code that would have been written, to be looked up in Array 2, and then that Description is what I want to say

    So it'd be "Project blabla" instead of PR123321. 

  • VictorIvanidze Profile Picture
    13,083 on at

    Use "Filter array" action.

  • MortenBak Profile Picture
    152 on at

    Hello Victor,

    I tried using Filter Array, and I'm positive I messed something up. 

    I had it in the beginning of a for Each, and used my array, and Array X PR code = Array Y PR code. 
    I ended up sending myself over 2500 emails, and there's about 80 PR Codes

  • VictorIvanidze Profile Picture
    13,083 on at

    Show your flow.

  • MortenBak Profile Picture
    152 on at

    Hello Victor,

     

    I have removed the second array, because I can't find the time to work on flow for a few months, and it needs to work. The PR codes can be looked up, and its still a big improvement over what we had before. 

    The flow is now as follows; 

    Here at the start, I'm using a custom connector to access data from Business Central, initialise a variable with a number for comparison later, and initialising my data into an object. 

    MortenBak_0-1680154105668.png

    I then transform my object into an array, using 

    variables('Sagsopgavelinjerne').Value

    Splitting up the array, so it knows whats what, and at the end Parsing the JSON. 
     

    MortenBak_1-1680154320709.png

    At the end here is my ForEach, which is a few filters in a condition, and then I send if off in a email to one of the consultants. 

    MortenBak_2-1680154409925.png

    In the Email, the Job_No, is the PR code, where I want it to look into the other array, which I can quickly build up again, and say "I have PR code this, so I should only care about the data where PR code matches" 

    I hope this makes good enough sense

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 317 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 247

#3
Henil Profile Picture

Henil 117

Last 30 days Overall leaderboard