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 / String Substitution / ...
Power Apps
Answered

String Substitution / Replacement Help

(0) ShareShare
ReportReport
Posted on by 112

I have the following form.  Currently, as the First Name and Last Name fields are entered, the text is concatenated together to populate the Display Name field.  

 

To do this I'm using:  (where DataCardValue2 = First Name & DataCardValue3 = Last name) on the Default value of the Display Name text field.

 

Concatenate(DataCardValue2.Text," ",DataCardValue3.Text)

 

 

Now, I need to substitute/replace the Display Name's First Name with the name entered into the Nick Name field (if it isn't blank).

 

I was trying to use this on the Nick Name (DataCardValue4) OnChange property but it doesn't work.

 

Substitute(DataCardValue1.Text,DataCardValue2.Text,DataCardValue4.Text,1)

 

 

In this example I would want the Display Name to say "Johnny Doe" now instead of "John Doe".  If Nick Name exists it only needs to update the first name of the Display Name text.  Does this make sense? 

 

form2.png

Thank you for some help.

-Greg

Categories:
  • Verified answer
    TheRobRush Profile Picture
    11,128 Moderator on at

    Lets say I have 3 text inputs

    First
    Last

    Nick

    In my label i place

    Switch(
     IsBlank(Nick.Text),
     true,
     Concatenate(First.Text," ",Last.Text),
     Concatenate(Nick.Text," ",Last.Text))
  • greddin Profile Picture
    112 on at

    Thank you Rob!  Why didn't I think of that?  Really appreciate your help again 🙂 

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 224 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 189 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 126

Last 30 days Overall leaderboard