Skip to main content
Community site session details

Community site session details

Session Id : oNeJPdQZJ4HL6RoykQ+zno
Power Apps - Building Power Apps
Answered

Create a Toggle to prefix text to a Text Input field

Like (0) ShareShare
ReportReport
Posted on 20 May 2020 14:06:02 by

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:
  • Verified answer
    Community Power Platform Member Profile Picture
    on 21 May 2020 at 14:04:55
    Re: Create a Toggle to prefix text to a Text Input field

    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);

  • BrianS Profile Picture
    2,407 Super User 2024 Season 1 on 20 May 2020 at 14:26:05
    Re: Create a Toggle to prefix text to a Text Input field

    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

     

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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410 Super User 2025 Season 2

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 2

Loading complete