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 / Help with understandin...
Power Automate
Answered

Help with understanding variables

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I need to understand how to obtain variables with Get_items.  Seems my options are List of Items and value.  Value gives me body('Get_items')?['value'] i tried Initialize variable with tolower(concat(substring(body('Get_items')?['Firstname'],0,1),body('Get_items')?['Title'])) but get an error of NULL value.  

 

Untitled.jpg

Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @Anonymous You need to use the correct string of values. For you it should look something like this:

     

    body('Get_items')?['value'][0]?['Title']

    Notice the [0] selects the first object in the array 'value'. If you want to cycle through every object in the array (if there are multiple results) then you need to use 'apply to each'. For only one value just use the [0] to select the first value in the array.

     

    The easiest way to see what the correct syntax should be is choose a value directly from the 'dynamic content' window like 'title' for your variable. It will automatically put your variable inside an apply to each. You can then look at the formula it provides for the apply to each and for your variable to see what the correct syntax should be. 

  • Verified answer
    v-bacao-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

     

    We can traverse the information contained in each item obtained by Get items in Apply to each.

    Basically, when configuring Value is in Initialize variable action, the available Dynamic content is automatically displayed according to the Type you set.

     

    For example, if you initialize an array variable, then only the value, as below:34.PNG

     

    If you want to get Title and other field value contained in the item and concat them to the value of the variable, you could set the type to String.

    At this time, we need to use Apply to each and Set variable action, traversing the Body returned by Get items and assigning values to variables need to use Apply to each, but Initialize variable action cannot be done in Apply to each.37.PNG

     

    Expression:

    tolower(concat(substring(item()?['Firstname'],0,1),item()?['Title']))

    Another way to consider is to use Compose, as shown above.

     

    Hope it helps.

     

     

    Best Regards,

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    How about this one. I am trying to use Middle Name in an Expression.  I have tried if(equals(items('Apply_to_each')?['Middle_x0020_Name'], null) and if(equals(items('Apply_to_each')?['Middle Name'], null) with no luck.

     

    Untitled.jpg

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

Haque 304

#2
David_MA Profile Picture

David_MA 245 Super User 2026 Season 1

#3
Expiscornovus Profile Picture

Expiscornovus 243 Most Valuable Professional

Last 30 days Overall leaderboard