Announcements
I'm building a form for Users to populate others to populate and then update a text box and the Users will then copy that text and input into a. The Populate Text button activates a flow that grabs file context from a Txt file and inserts it into a text box with var"" parameters. We then want the Users to fill out the form and click the Update Text button so that the var"" get substituted/replaced with the given values in the form. What's working is populating the text box with the file contents. What's not working is the substitution. I could use some help please. See screenshots below.
Hi @MrGrant ,
The issue is that the Substitue functions are not nested in the Set function, meaning that the changes they are making are not saved in the variable.
If you need any help with that, please post your formula as text instead of a screenshot.
Sorry about that, here are the functions I have for the PowerApp so far.Text Box: varResultsTempPopulate Text Button:Set(varResultsTemp,'CCAConstants-GetConstants'.Run().constantstext)Update Text:Set(varResultsTemp,varResults);Substitute(varResults,"<varProjectEmail>",ProjectEmail.Text);Substitute(varResultsTemp,"<varProjectName>",ProjectName.Text);UpdateContext({varResults:varResultsTemp})
This should do the trick:
Set( varResultsTemp, Substitute( Substitute( varResults, "<varProjectEmail>", ProjectEmail.Text ), "<varProjectName>", ProjectName.Text ) ); UpdateContext({varResults:varResultsTemp})
BCBruizer, thanks for responding again. So, I input your suggested context into my button and it has a red x. The sequence is, I push the Populate button to grab file contents from sharepoint and import into the text box field. Then I want to substitute/replace what Users fill in with the surrounding text inputs after I press the Stephen Test Update button. Nothing is happening when I push that button. The formality of the code you provided seems good. What's missing?
When I look at the formula in your screenshot, it seems different from what I posted. Can you please try to literally copy-paste my formula to the OnSelect property of the button?
I did copy it again and when I push the button it clears the populate text box instead of updating the input contents. I would like the text box to just update with the fields from the form. Is this possible?
I think the issue is that you started using two variables, but then switched to a single one. Eliminating varResults from the formula altogether shoud do the trick:
Set( varResultsTemp, Substitute( Substitute( varResultsTemp, "<varProjectEmail>", ProjectEmail.Text ), "<varProjectName>", ProjectName.Text ) );
Yes Sir, that worked! Thank you very much!!!!!
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.
Congratulations to our 2026 Super Users!
Congratulations to our 2025 community superstars!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
11manish 551
WarrenBelz 430 Most Valuable Professional
Valantis 298