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 / Create a Toggle to pre...
Power Apps
Answered

Create a Toggle to prefix text to a Text Input field

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I am creating an App that will create Sites based on the information input into the App. The first Input Text field will be the Site Name field. Further down the App will be a Toggle input (to allow or not allow external users) that if selected would need to append "External - " into the first Input Text field for the name of the site. One caveat to this scenario is that the appended text needs to be uneditable so that the user doesn't try to bypass the naming convention for External capable sites.

 

So far This is what I've done.

 

I have a Text Input field: "InputSiteName" 

The "Default" setting is set to "EXT_Toggle & " " "

 

I have a Toggle input: "ToggleExternal"

The "OnCheck" value is set to "UpdateContext({EXT_Toggle: "External -"})"

The "OnUncheck" value is set to "UpdateContext({EXT_Toggle: ""})"

 

This works to add the "External - " into the Name field but it removes the previous text and does not append it. How can I get this to append to whatever text is already in the name input field?

 

Categories:
I have the same question (0)
  • BrianS Profile Picture
    2,407 Super User 2024 Season 1 on at

    It seems like that default would ignore the text input.

    I think the default should be something like "EXT_Toggle & ThisItem.InputSiteName"

    that will add the toggle value to the user input without showing that value to the user

     

  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I found solutions to my issues by using a Substitute and adding a readolny flag to the startup of the app.

     

    These were modifications I used on the OnUncheck for the Toggle switch.

    UpdateContext({EXT_Toggle: Substitute( "External - " & InputSiteName.Text, "External - ", "")});
    Set(readOnlyFields,false);

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

#2
11manish Profile Picture

11manish 184

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 86 Super User 2026 Season 1

Last 30 days Overall leaderboard