web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to get string befo...
Power Automate
Unanswered

How to get string before a character appearing multiple times in power automate

(0) ShareShare
ReportReport
Posted on by

I have this string and I need to get the first character before my date value start. so for example if I have name as ZXDER_20201209220430Z I need ZXDER, if I have ZXDDFR_IUT_23_20201209220430Z I need ZXDDFR_IUT_23. How do I do this once in Power automate. My value after last underscore will always be date value.

Categories:
I have the same question (0)
  • Gopala_Krishna Profile Picture
    1,495 on at

    @Anonymous 

    You can achieve this using below expression in power automate

    substring(outputs('Compose'),0,lastIndexOf(outputs('Compose'),'_'))

    Replace the outputs('Compose') to the action from where you are fetching the data.

    For my example I have taken the sentence how_are_you and stored it in compose action.

    Gopala_Krishna_0-1614605665171.png

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    if the information shared helps you, please consider giving a thumbs up and mark solution as resolved

  • Community Power Platform Member Profile Picture
    on at

    @Gopala_Krishna great!!! and what if we need the date part, i.e. the value after last "_"

  • Verified answer
    Gopala_Krishna Profile Picture
    1,495 on at

    @Anonymous 

    You can use below expression for that

    substring(outputs('Compose'),lastIndexOf(outputs('Compose'),'_'),length(outputs('Compose')))

     

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    if the information shared helps you, please consider giving a thumbs up and mark solution as resolved

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 523 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 406 Moderator

#3
abm abm Profile Picture

abm abm 245 Most Valuable Professional

Last 30 days Overall leaderboard