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 the second value i...
Power Apps
Answered

Get the second value in a string

(0) ShareShare
ReportReport
Posted on by 402

Need a second pair of eyes.  Why is this not returning the middle value of a three value string?  The first and last are working great.  

 

ForAll(
 Split(
 txtOutput.Text,
 "###"
 ),
 Collect(
 FinalizeCollection,
 {
 Type: First(
 Split(
 Result,
 ";"
 ).Result
 ).Result,
 Name: Trim(LastN(
 Split(
 Result,
 ";"
 ).Result
 ).Result),
 ID:Last(
 Split(
 Result,
 ";"
 ).Result
 ).Result
 }
 )
);

 

Thanks 

 

EDIT

I was able to figure it out by doing this, but isnt there a better way?

 

Name: Trim(First(LastN(
Split(
Result,
";"
).Result,2)
).Result),

Categories:
I have the same question (0)
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @iskguy 

    Could you post a few examples of the strings you want to parse?

  • iskguy Profile Picture
    402 on at
    JR;ANDRE CORTEZ BROWN Jr;4658ae6d-ab8c-49c9-acbf-f8188dfa3d13###JR;BETH ANN FARROW ;c63a4b04-2519-4120-989b-c831402d1f7b###JR;BRIAN DORAL HAMILTON ;dd179c74-de13-4314-bd9d-91be6da51804###JR;CALEB ARTHUR SEGOBIA ;46caa027-028d-468c-b5ba-181241ba5372###JR;CHARLES KEITH RANGEL ;5e9c21ef-b7aa-4b6e-97ce-94dfe660ae92###JR;HENRY AUSTIN RISNER ;d05b04b8-960a-4866-9a73-9d1bcb3b285c###JR;HERIBERTO CONTRERES Jr;6141e0fe-4756-4559-acf5-67673c1ea430###JR;JASON BRADLEY RHOADES ;54249dab-c85e-4da4-bc6a-6208c212e090###JR;KYLER JEAN CORNETT ;a5d1d77f-da96-456e-b912-47fe7214b3bb###JR;MALIK LAMONT ALEXANDER ;665845e1-c65d-4cc0-9682-165373a9a140###JR;MARQUAVION MARCELL COLEMAN ;c22f2d24-afed-4933-89a3-a87c69f7aefd###JR;MAURICE RAFAEL MARTIN ;e0c646d3-0b1c-4478-ac96-4601845e79e6###JR;MICHAEL PAUL RITTER ;d3941909-026b-4937-a427-ffa6851607f2###JR;SCOTT ALAN SAUNDERS Jr;ea8bc638-1d6e-40ab-b8ae-8325adbb9129###JR;SCOTT EUGENE FILKINS ;a2237e30-db4a-4dbf-ab8e-5457dd354296###JR;THOMAS ANTHONY IVY ;ac639d87-ab17-4d57-985e-596a1032a5fc###JR;ZACHERY SCOTT WEHNER ;104f6446-7810-4113-a98f-0623ca253c0b###
  • Verified answer
    WarrenBelz Profile Picture
    155,640 Most Valuable Professional on at

    Hi @iskguy ,

    Try this approach

    With(
     {
     wParsed: 
     Split(
     txtOutput.Text,
     ";"
     ).Result
     },
     With(
     {
     wNumbered: 
     ForAll(
     Sequence(CountRows(wParsed)),
     Patch(
     Last(
     FirstN(
     wParsed,
     Value
     )
     ),
     {RowNo: Value}
     )
     )
     },
     With(
     {
     wOdd: 
     Filter(
     wNumbered,
     Mod(
     RowNo,
     2
     ) = 1
     )
     },
     ClearCollect(
     colParsed,
     ShowColumns(
     AddColumns(
     wOdd,
     "Id",
     LookUp(
     RenameColumns(
     wNumbered,
     "RowNo",
     "Row"
     ),
     Row = RowNo + 1
     ).Result
     ),
     "Result",
     "Id"
     )
     )
     )
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 426

#2
WarrenBelz Profile Picture

WarrenBelz 381 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 315 Super User 2026 Season 1

Last 30 days Overall leaderboard