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

Substitute minus 1

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi all,

I want to read into PowerApps files that may look like this:

Nr.5.3.10.03.1959.bla.pdf.

I now want to change the file name so that it contains only one dot, so then like this: Nr5310031959bla.pdf

But the number of dots can vary.

I try with different commands to solve the problem (Replace, Substitute, ForAll, Split etc.), but I don't get a solution.

Does anyone here give me an idea ?

 

Regards

Herb

 

 

Categories:
I have the same question (0)
  • Manan-Malhotra Profile Picture
    621 Super User 2024 Season 1 on at
    Substitute("Nr.5.3.10.03.1959.bla.pdf",".","")

    This will Remove dots however it will also remove dot before pdf, if this works for you use this!

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi Manan-Maolhotra,

    thank you for the quick feedback.

    But with your example all points are deleted.

    But I still need the dot in front of the file extension (i.e. x.pdf), otherwise the file is no longer valid.

     

    Regards

    Herb

  • Manan-Malhotra Profile Picture
    621 Super User 2024 Season 1 on at

     

     

     

    Substitute(Left("Nr.5.3.10.03.1959.bla.pdf",Len("Nr.5.3.10.03.1959.bla.pdf")-4),".","")&".pdf"

     

     

     

    Use this then, hope this helps

     

    You can use a label for the name here    "label.Text"

     

    @Anonymous 

    Please Accept as Solution if it solves your question Or just give it a Thumbs Up if it is helpful because this can help others.

    LinkedIn: https://www.linkedin.com/in/manan-malhotra-vfx/

    Want to support me! Buy me a Cup of Coffee?

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    The PDF file was only an example, it could also be an office document, e.g. x.docx or x.xlsx.

    Then the with - 4 does not work anymore 🤔

  • Verified answer
    theapurva Profile Picture
    970 Super User 2024 Season 1 on at

    Hello @Anonymous ,
    please find formula as below:

     

    Concatenate(Concat(Remove(Split("Nr.5.3.10.03.1959.bla.pdf","."),Last(Split("Nr.5.3.10.03.1959.bla.pdf","."))),Result),".",Last(Split("Nr.5.3.10.03.1959.bla.pdf",".")).Result)

     

    Want To Support me? Buy me a Coffee

     

  • fuzzy_fuzz Profile Picture
    229 on at

    Hi @Anonymous 

     

    Maybe using collections to separate the file extension would work.

     

    I made this:

    ClearCollect(collection, Split(Label19.Text, "."));
    Set(varExtension, Last(collection).Result);
    Remove(collection, Last(collection));

     

    Then concatenate everything

     

    Concat(col,Result) & "." & varExtension

     

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    hI @theapurva;

    great, that's how it works. Thanks a lot for your help.

     

    Regards

    Herb

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @fuzzy_fuzz,

    Thank you for your tip, but I have already decided to use the solution of @theapurva 

     

    Regards

    Herb

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

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 335 Most Valuable Professional

#2
11manish Profile Picture

11manish 166

#3
sannavajjala87 Profile Picture

sannavajjala87 71 Super User 2026 Season 1

Last 30 days Overall leaderboard