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

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

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

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard