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 Automate / Find text position ret...
Power Automate
Answered

Find text position returns -1

(1) ShareShare
ReportReport
Posted on by Microsoft Employee

Ssp_power_0-1645798114398.png

 

Please refer to the embedded screenshot. I have tried to get offset of string "type=" in the message and it returns -1. What is wrong here ? What should be done to get the correct offset ?

Categories:
  • Ellis Karim Profile Picture
    12,323 Super User 2026 Season 2 on at

    Do you mean that you want to extract the substring string 'story' from the string 'create type=story title=abcde'?

     

    Ellis

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi Ellis,

    I realized that I had flipped "Text" and "Search Text" and hence I was getting -1 as the offset. I swapped these and I got it. Now based on your reply, am curious, how do I parse the key value parameters ? 

  • Verified answer
    Ellis Karim Profile Picture
    12,323 Super User 2026 Season 2 on at

    Will type and title only contain single words such as:

    type=story title=abcde

     

    Or Will type and title contain multiple words such as:

    type=non fiction title=Travel to Mars

     

    Do you want to extracts both type and title? To extract type and title - when they are single words only - you can use the following expressions:

     

    Type:
    trim(first(split(last(split(variables('varText'),'type=')), 'title=')))
    
    Title:
    Last(split(variables('varText'),'='))

    Snag_cb1a9e1.png

     

    Snag_cb292ba.png

     


    Ellis
    ____________________________________
    If I have answered your question, please mark the post as Solved.
    If you like my response, please give it a Thumbs Up.

     

     

     

     

     

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thanks Ellis. Yes, the values would be phrases (not just words). I will take it from here. 

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 426

#2
11manish Profile Picture

11manish 345 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 308

Last 30 days Overall leaderboard