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 / How to extract element...
Power Automate
Answered

How to extract elements from array and assign it to a string?

(0) ShareShare
ReportReport
Posted on by 12

Hi All i have an array Results as below:

[
  "Customer Name",
  "AAA111222DEF",
  "2"
]
 
I need to extract the first and last element and assign it to a new String CustomerName and CustomerID, can someone please suggest as i am new to this development.
 
Appreciate any help.
Regards
 
Categories:
I have the same question (0)
  • CU-18081211-6 Profile Picture
    9,270 Moderator on at

    @anshul ,

    You can refer to a particular item of an array with:

    variables('Results')[0] - first item from Results array ;

    variables('Results')[1] - second item from Results array;

    and so on ...

    To set a value of CustomerName variable you can use either initialize variable or set variable action (depends of the scenario) and use as value the first element of the array: variables('Results')[0]. 

    Hope it helps !

  • anshul Profile Picture
    12 on at

    my question, where do i type this variables('Results')[0] ? in expression window? can you please explain in detail on typing this in which action or which window?

  • Verified answer
    CU-18081211-6 Profile Picture
    9,270 Moderator on at

    @anshul ,

    Here is what I have in mind ... 

     

    gabibalaban_1-1636103875001.png

    "where do i type this variables('Results')[0] ? in expression window?"

    Being a formula you need to used add dynamic contents -> expression.

     

    gabibalaban_0-1636103848116.png

     

  • anshul Profile Picture
    12 on at

    @gabibalaban thank you so much 🙂

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 557

#2
Valantis Profile Picture

Valantis 328

#3
David_MA Profile Picture

David_MA 264 Super User 2026 Season 1

Last 30 days Overall leaderboard