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 Apps / Get Nth Item from the ...
Power Apps
Answered

Get Nth Item from the result of Split function

(0) ShareShare
ReportReport
Posted on by 249

Hi,

I have to get the 5th & 6th item splitted by '/' in an URL (like : "https://hello.com/sites/customer/portal/details") which is customer & portal.
I have used the split function and stored it in collection with one Column (Result).

ClearCollect(colSplittedURL,Split(TextInputURL.Text,"/"))

How can I get Nth (5th & 6th) item from collection colSplittedURL?

 I know First(colSplittedURL) gives the first item and Last(colSplittedURL) gives the last item of the collection but I don't know how to get soemthing in the middle.

 

Thanks,

Nabin

 

 

Categories:
I have the same question (0)
  • Verified answer
    CarlosFigueira Profile Picture
    Microsoft Employee on at

    You can use a combination of the FirstN and Last functions to access an item at a specific index. To get the 5th element from your collection you'd use

    Last(FirstN(colSplittedUrl, 5))

    And similarly for the 6th element:

    Last(FirstN(colSplittedUrl, 6))

    Hope this helps!

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    "Sameer : CKayako : Shaikh : Manish Aggarwal :"

    Is it possible to split in any suggestion 

    Sameer

    CKayako

    Shaikh

    Manish Aggarwal

    Separately in different 4 Text-input Box

  • pNabin Profile Picture
    249 on at

    @Anonymous Could you try:

    Split(StringToSplit,":")

    And you can remove the last item as it is empty because of ":" at the end. 

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @pNabin 

    Thanks for Help.

    but it still shows this error.

    Error-1.PNG

    Error-1.PNG
  • liridonuka Profile Picture
    46 on at

    Try:

    First(Split(Label58_1.Text,":")).Value or Last(Split(Label58_1.Text,":")).Value

    as it expects text value

  • IvoYanWL Profile Picture
    8 on at

    Now there's the Index function:

    Index(Split(myString, delimiter), 1) - returns a row/record at index 1;

    Index(Split(myString, delimiter), 1).Value - returns the value/substring of the row/record at index 1;

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 Apps

#1
11manish Profile Picture

11manish 536

#2
WarrenBelz Profile Picture

WarrenBelz 426 Most Valuable Professional

#3
Haque Profile Picture

Haque 305

Last 30 days Overall leaderboard