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 Apps
Unanswered

Text Display

(0) ShareShare
ReportReport
Posted on by 261

Ok, here is my question

 

I have a text box that displays a randomly generated letter, when this box is selected it will generate another letter. This works fine. 

 

I want to create a label that will keep the original letter first shown so I can share both the original and the second randomly generated letter. 

 

If i set the "text" to the same that's in the text box it will also change on the second box. I need it to keep the letter from first independently of what happens... Any help would be appreciated. 

Categories:
I have the same question (0)
  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hey @Courtney 

     

    You can use a variable to track this. You can set the "OnChange" property of the textinput control as:

    Screen -> OnVisible -> Set(FirstLetter,"")
    TextInput1 -> OnChange -> If(IsBlank(FirstLetter),Set(FirstLetter, TextInput1.Text))

    You can use the variable FirstLetter and it will always retain the first generated value.

     

    Hope this Helps!

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Deleted

  • Courtney Profile Picture
    261 on at

    Hi, the text that displays the letters are labels rather than text inputs. There is a formula that is already set for OnVisible that will automatically generate these letters with out having to enter any information. The second text label just needs to capture this entry but not that change once pressed. 

  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hey @Courtney 

     

    If they are labels and the value is calculated on Page visible, you can set this value in the FirstLetter variable there itself and use it afterwards.

    Can you share more details on how this second value is generated?

     

    Hope this Helps!

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

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

    Hi @Courtney ,

    Could you share the codes for generating the letter? (OnVisible of screen and OnChange)

    I am with yashag's post. You should use variable to save the original letter when it is generated at OnVisible property of screen, then set variable to Text of second label.

    if you can share more codes, we can provide further assistant.

    Best regards,

    Sik

  • Courtney Profile Picture
    261 on at

    "There was a lot of support given with this formula so I'm not too sure how it all works at the moment but I know it works!" 😅

     

    Here is the code for (OnHidden):

     

    Set(randletter,First(Shuffle(Letters)).Result);Set(randletter1,First(Shuffle(Filter(Letters,Result<>randletter))).Result);Set(randletter2,First(Shuffle(Filter(Letters,Result<>randletter,Result<>randletter1))).Result);Set(randletter3,First(Shuffle(Letters)).Result)

     

    Here is the code I for (OnVisible):

     

    ClearCollect( Letters, Split( "ABCDEF", "" ) ); ClearCollect( Letters1, Split( "ABCDEF", "" ) ); ClearCollect( Letters2, Split( "ABCDEF", "" ) ); ClearCollect( Letters3, Split( "ABCDEF", "" ) ); UpdateContext({UpperCaseValue: ""}); Set( randletter, First(Shuffle(Letters)).Result ); Set( randletter1, First( Shuffle( Filter( Letters, Result <> randletter ) ) ).Result ); Set( randletter2, First( Shuffle( Filter( Letters, Result <> randletter, Result <> randletter1 ) ) ).Result ); Set( randletter3, First(Shuffle(Letters)).Result )

     

    I just need 3 new labels to reflect the 3 original letters generated (OnVisible) that will not change if the original 3 are selected. The idea being that the app will submit the original letters generated along side the new letters. 

    When the data is submitted the process will reset and repeat. 

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 July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard