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 / PowerApps remove last ...
Power Apps
Answered

PowerApps remove last part of string

(0) ShareShare
ReportReport
Posted on by 70

Hello,

 

in PowerApps forms, i have a string /sites/SkoleniSFRB/Reporty/DataSP/01.jpg. I need to remove part 01.jpg so string remains.

 

Can please someone help me? 

 

Thank you.

Categories:
I have the same question (0)
  • Verified answer
    TheRobRush Profile Picture
    11,128 Moderator on at

    where Label10 is our string

    Concat(FirstN(Split(Label10.Text,"/"),CountRows(Split(Label10.Text,"/"))-1),Result,"/")&"/"
  • JmeBrey Profile Picture
    55 on at

    Yes , a few ways to achieve this - you will have to select which is the best option for you, for example if the string can end with different file names, you may need to adjust the formula accordingly.

     

    Substitute("/sites/SkoleniSFRB/Reporty/DataSP/01.jpg", "/01.jpg", "")

     

     

     

    Replace("/sites/SkoleniSFRB/Reporty/DataSP/01.jpg", Right("/sites/SkoleniSFRB/Reporty/DataSP/01.jpg", 6), "")

     

    This formula uses the "Right" function to extract the last 6 characters (which is the length of "01.jpg"), and then uses the "Replace" function to replace those characters with an empty string, effectively removing them from the original string

     

    Left("/sites/SkoleniSFRB/Reporty/DataSP/01.jpg", Len("/sites/SkoleniSFRB/Reporty/DataSP/01.jpg")-6)

     

     

    This final one is good if you want to remove everything after the last "/" regardless what the text is

    Concat(Split("/sites/SkoleniSFRB/Reporty/DataSP/01.jpg", "/"), "/", CountRows(Split("/sites/SkoleniSFRB/Reporty/DataSP/01.jpg", "/"))-1)



  • TheRobRush Profile Picture
    11,128 Moderator on at

    Use the method I outlined in my response, it will work regardless of the file name, or length of rest of fullpathname etc.

  • Krentor Profile Picture
    70 on at

    Thank you very much! That helped me. Love this community. 

     

    Regards,
    Jakub

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 482 Most Valuable Professional

#2
11manish Profile Picture

11manish 459

#3
Haque Profile Picture

Haque 331

Last 30 days Overall leaderboard