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
    16,135 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!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 552

#2
Valantis Profile Picture

Valantis 388

#3
11manish Profile Picture

11manish 375

Last 30 days Overall leaderboard