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

Substitute minus 1

(0) ShareShare
ReportReport
Posted on by

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
    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
    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
    on at

    hI @theapurva;

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

     

    Regards

    Herb

     

  • Community Power Platform Member Profile Picture
    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

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard