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 / Substitute / with " "
Power Apps
Answered

Substitute / with " "

(0) ShareShare
ReportReport
Posted on by 8

I have a form connected to a SharePoint list and I've added one of the fields (Contract Reference) which is a Data Input control.

 

Whenever someone copy pastes a text there containing a "/", I want it to automatically change the "/" to a " " (blank space).

Everywhere I look suggests to use this formula in the Default field: Substitute(ContractReference.Text, "/", " "). However, it says that  .Text isn't a valid argument.

 

Can someone please help me figure out what is the issue with this formula? Thanks!

 

 

 

Categories:
I have the same question (0)
  • v-mingkz-msft Profile Picture
    Microsoft Employee on at

    Hi @Jk14,

    Could you please tell me what the type of fields (Contract Reference)?

    If it is number Please try

     

    Substitute(Text(ContractReference), "/", " ")

     

     

    Best Regards,

    Kyrie

  • timl Profile Picture
    36,715 Super User 2026 Season 1 on at

    @Jk14 - In a form, you would access the field value through the ThisItem keyword like so:

    Substitute(ThisItem.ContractReference, "/", " ")

     

  • Jk14 Profile Picture
    8 on at

    Hi!

     

    the field is set as a text (single line of text). 

    I've tried the formula and it says that it expects a text and not the field name (contract reference).

  • Jk14 Profile Picture
    8 on at

    Hi!

     

    Thank you for the explanation, I has actually tried that one before, and while I don't get any errors, it simply doesn't work. The "/" remain there in the text.

  • v-mingkz-msft Profile Picture
    Microsoft Employee on at

    @Jk14 

    Could you please show some screenshots about your control?

     

  • Jk14 Profile Picture
    8 on at

    @v-mingkz-msft 

     

    Here are the screen shots. thank you for the help.

     

     

    Screenshot 2023-08-31 090041.png
    Screenshot 2023-08-31 090426.png
  • Verified answer
    v-mingkz-msft Profile Picture
    Microsoft Employee on at

    @Jk14 

    You can set the OnChange property of DataCardValue1 as:

    Set(var,Substitute(DataCardValue1.Text, "/", " "))

    And set the Default property as:

    var

     

  • Jk14 Profile Picture
    8 on at

    Thank you @v-mingkz-msft. It worked! 

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 549 Most Valuable Professional

#2
Kalathiya Profile Picture

Kalathiya 225 Super User 2026 Season 1

#3
Haque Profile Picture

Haque 224

Last 30 days Overall leaderboard