Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Button Onselect to send variable values to DataCardValue

(0) ShareShare
ReportReport
Posted on by

Hello all,

 

I have a button labelled 'Paste'. OnSelect I want this button to paste a value into DataCardValue29 on the same screen. The variable (TOO) has been set previously. The code I am trying is below and compiles but doesn't paste.

 

DataCardValue29.Text = TOO;

 

I tried using UpDateContext but without success.

 

Thank you in advance.

 

Rob 

  • Verified answer
    AndrewR1 Profile Picture
    1,572 Super User 2025 Season 1 on at
    Re: Button Onselect to send variable values to DataCardValue

    @rob4681 If you put the set on select of the button this will only paste this when the button is selected not evetime you change the TOO variable you could add in a if statement to check that the paste text is blank: 

     

    DataCardValue29 text property to:

     

    If(IsBlank(VarPasteText),"",VarPasteText)

     

     

    Please click Accept as solution if my post helped you solve your issue. ✔️ This will help others find the solution to this problem. It also closes the item. Remember, you can accept more than one post as a solution.

    If the content was useful in other ways, please consider giving it Thumbs Up. 👍

    Thanks
    Andrew

  • rob4681 Profile Picture
    on at
    Re: Button Onselect to send variable values to DataCardValue

    Am I right in thinking this will update the DataCardValue29 every time? I have already set the TOO variable on a different canvas. I want the option,

    If the paste button is pressed: pass the text of the TOO variable to DataCardValue29

    If the paste button is not pressed: Manual text entry to DataCardValue29 is possible or can be left blank.

     

    Thanks again.

  • AndrewR1 Profile Picture
    1,572 Super User 2025 Season 1 on at
    Re: Button Onselect to send variable values to DataCardValue

    Hi @rob4681 you can use Set Function to set a variable like so:

     

    Set(VarPasteText,TOO)

     

     

    Then have the DataCardValue29 text property to:

     

    VarPasteText

     

    Please click Accept as solution if my post helped you solve your issue. ✔️ This will help others find the solution to this problem. It also closes the item. Remember, you can accept more than one post as a solution.

    If the content was useful in other ways, please consider giving it Thumbs Up. 👍

    Thanks
    Andrew

     

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,702 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,015 Most Valuable Professional

Leaderboard