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 / Referencing part of an...
Power Automate
Answered

Referencing part of an array by element name

(0) ShareShare
ReportReport
Posted on by 200

Hi, 

 

I have an array :

 

[
  {
    "ExcelColumnName""First Name",
    "MatchingEmployeeColumnName""Forenames"
  },
  {
    "ExcelColumnName""Surname",
    "MatchingEmployeeColumnName""Surname"
  },
  {
    "ExcelColumnName""National Insurance Number",
    "MatchingEmployeeColumnName""NINumber"
  }
]
 
i want to be able to reference one of the rows in the array by using the "MatchingEmployeeColumnName" column, to get the "ExcelColumnName" column 
 
example : i want to get the "ExcelColumnName" for the element that contains "NINumber" ..
 
is this possible in Power Automate?
 
 
Categories:
I have the same question (0)
  • Verified answer
    tom_riha Profile Picture
    10,185 Most Valuable Professional on at

    Hello @DragonLord ,

    you can't reference it directly, but you can use the 'Filter array' action to filter only the entry where MatchingEmp... equals a specific NINumber. The output of the 'Filter array' will be a single object where you can extract the NINNumber using an expression, that might look like this:

    first(body('Filter_array'))?['ExcelColumnName']

    image.png

  • DragonLord Profile Picture
    200 on at

    i did try filter. it works. i was hoping for something more dynamic as i would need to identify 88 fields. thats a lot of filters .. lol

  • tom_riha Profile Picture
    10,185 Most Valuable Professional on at

    If you could change the input data format to have all the information as a single object, it would be much easier, you'd just access the specific values:

    {
     "First Name": "Forenames"
     "Surname": "Surname"
     "National Insurance Number": "NINumber"
    }
    
    <the object>?['First name']
    <the object>?['Surname']
    <the object>?['National Insurance Number']

     But if it must be an array where each property will be a separate object then I have to agree, it'll be a lot of filters.

  • DragonLord Profile Picture
    200 on at

    tried that , no success :

    The template language expression 'variables('excelTUPEFieldList')?['Surname']' cannot be evaluated because property 'Surname' cannot be selected. Property selection is not supported on values of type 'String'.

     

    {
    "First Name": "john",
    "Surname": "doe",
    "National Insurance Number": "1234"
    }

  • tom_riha Profile Picture
    10,185 Most Valuable Professional on at

    Did you define that the variable is of type Object? Wasn't it initialised as a string?

  • DragonLord Profile Picture
    200 on at

    i changed from a variable to a Compose , and i could reference it.

    Just need to create the string object now from the table that returns the rows.

  • Verified answer
    tom_riha Profile Picture
    10,185 Most Valuable Professional on at

    image.png

  • DragonLord Profile Picture
    200 on at

    yes, this worked well for me.
    learned something new today.

     

    "dÄ›kuji a na zdraví" 🙂

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 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard