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 Automate
Answered

Extract sub string

(3) ShareShare
ReportReport
Posted on by 12
Hello all.

I have an out from get file content as. (Reading text file)

ERID:31200
CaseNumber:12345
 
From this I need to extract CaseNumber (12345).

I've tried the following expression  trim(split(split(body('Get_file_content'), '\n')[1], ':')[1])
But getting out of index error.
 
Categories:
I have the same question (0)
  • Verified answer
    trice602 Profile Picture
    15,915 Super User 2026 Season 1 on at
    Hi,
     
    One way to do this is to find the position of the label "Case Number" then add 11 to it and extract the next 5 characters, shown below.  Remember this is 0-based use adjust the "12" number of characters to match the actual format in your text.
     
    substring(body('Get_file_content'), add(indexOf(body('Get_file_content'), 'CaseNumber:'), 12), 5)
     
    ------------------------------------------------


    If this was helpful, please like and/or mark as a verified answer to help others find this too!


    Always glad to help! 💯💯💯💯💯

    Tom 

    Follow me on LinkedIn - Thomas Rice, PMP | LinkedIn

     

     

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

David_MA 86 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 55

#3
Ellis Karim Profile Picture

Ellis Karim 53 Super User 2026 Season 1

Last 30 days Overall leaderboard