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 / Extracting Value from ...
Power Automate
Unanswered

Extracting Value from Specific Column in SharePoint Custom List Based on Internal Name as Variable

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello,

 

I have a Variable Array that contains the column names ("Tracker Columns").  Its format is:

 

[
{
"Column Name": "AIO Approval (S)",
"Internal Name": "AIO_x0020_Approval_x0020_Status"
},
{
"Column Name": "Approval Queue (S)",
"Internal Name": "Approval_x0020_Queue_x0020_Statu"
},
{
"Column Name": "BOM Ready (S)",
"Internal Name": "BOM_x0020_Ready_x0020_Status"
}, .....

 

This Variable Array contains a subset of names found in the SharePoint Custom List - "Tracker."

 

My goal is to use "Apply to each" to traverse the "Tracker columns," ideally setting a string variable - "New Status Value" - when for the desired columns only.  I have tried using - triggerBody()?variables('Current Internal Name')?['Value'] - whereby the italisized portion of the statement would be variable.  However, when I try to save I get "Expression is invalid."  Note: Current Internal Name has the format - ["AIO_x0020_Approval_x0020_Status"].  (I am unsure how to use concat to create a single quote versus the ones showing.  Thus, I could use a clue.)

 

Is there a way to feed a variable into a statement as per the example above?  If so, how?

 

All ideas, insight, and help is very much appreciated.

 

Cheers.

Categories:
I have the same question (0)
  • v-litu-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous,

     

    Please take the value from Specific column as below, use the item() to get current item of array, and then use "?" to get element and put the column name in the [''].Annotation 2019-10-23 113209.png

    Best Regards,
    Community Support Team _ Lin Tu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thank you for your insight.

     

    Following your advice I am able to construct a clean statement:

     

    triggerBody Compose.PNG

     

    However, using the statement in a subsequent action to derive the value of the target list simply returns the same text:

     

    triggerBody Compose 2.PNG

     

    The hopes were to obtain the value from the triggering list, column AIO_x0020_Approval_x0020_Status.

     

    What might I be missing?

     

    Cheers.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I've spent the better part of another day trying to achieve the goal of 'body' and 'triggerBody' construction based on internal names fed from another Variable Array.  No success!  (The goal is to use only the names within the Tracker Columns array, not all names available within 'body' or 'triggerBody.')  Here's a broader view:

     

    Loop.PNG

     

    Note that the Condition is always true currently because comparison values evaluate to nulls.  Here are the two statements:

     

    triggerBody()?[concat('''',variables('Tracker Columns')[variables('Loop Count')]?['Internal Name'],'''')]
    body('Get_items_-_Tracker_Last_Status')?[concat('''',variables('Last Status Columns')[variables('Loop Count')]?['Internal Name'],'''')]
     
    Any additional clues or am I just not going to be able to use third-element variables to achieve my mission?
     
    As alway, all insight is welcomed and appreciated.
     
    Cheers.
     
     
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Update:

     

    Using this statement:

     

    concat('body(','''','Get_items_-_Tracker_Last_Status','''',')?[','''',string(variables('Last Status Columns')[variables('Loop Count')]?['Internal Name']),'''',']?[','''','Value','''',']')

     

    I am able to form the desired output:

     

    body('Get_items_-_Tracker_Last_Status')?['AIO_x0020_Approval_x0020__x0028_']?['Value']  (example)

     

    But, obviously I simply get a string and not an executed statement.

     

    Any idea how to turn this into an executed statement?

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!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 608

#2
Valantis Profile Picture

Valantis 416

#3
11manish Profile Picture

11manish 348

Last 30 days Overall leaderboard