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 / Copy function with two...
Power Apps
Answered

Copy function with two buttons

(0) ShareShare
ReportReport
Posted on by 54

Hi all,

 

I have the following problem.

 

I have two buttons that should do the following. If I press the "Zählerstand HT kopieren" button, the data from the "Zählerstand HT 1.81" field should be copied to the "Zählerstand Vormonat HT 1.81" field. The same should happen with the "Zähleratnd NT kopieren" button, only for the NT values. The problem is. If I click the "Zählerstand HT kopieren" button, the values are also copied to the NT field. It's not supposed to be like that.

 

Any ideas?

thanks

Benjamin

 

 
 
 
 
Screenshot 2023-02-01 135943.png
Categories:
I have the same question (0)
  • Clem Profile Picture
    130 on at

    Hi,
    You need to use variable to handle your scenario.

    For the HT button, define a variable : 

    Set(varZTHT, Blank());

    On the Default value of the HT Vormonat field you set the variable name.

    On the OnSelect property of the button define :

    Set(varZTHT, ZHTField.Text);

     

    Reproduce the same for the other button and the other fields.


    Regards

  • Bennjamin Profile Picture
    54 on at

    Hi,

     

    thanks for your answer.

     

    So... for the button "Zählerstand HT kopieren" I set on OnSelect. Or is it wrong to set it on OnSelect?

    Set(varZTHT, Blank());

    In this case: Set(Copy;DataCardValue465);; Blank();;

     

    On the Default value of the HT Vormonat field you set the variable name. Which variable you mean? 

     

    Sorry 😕

  • Verified answer
    Clem Profile Picture
    130 on at

    Let's assume the "Zählerstand HT kopieren" button is called "btnZTH"

    the field "Zählerstand HT 1.81" is called DataCardValue1 & the field "Zählerstand Vormonat  HT 1.81" is called DataCardValue2.

     

    On the onstart or onvisible of the first screen you set a variable which will be used to display the copied value : 

     

    Set(varCopiedValue; Blank());;

     

    Then on the OnSelect of the button : btnZTH

    You define : 

    Set(varCopiedValue;DataCardValue1.Text);;

    On the field DataCardValue2 on the default property you put the variable named "varCopiedValue"

     

     

  • Bennjamin Profile Picture
    54 on at

    Thank you 🙂

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

#2
11manish Profile Picture

11manish 168

#3
sannavajjala87 Profile Picture

sannavajjala87 75 Super User 2026 Season 1

Last 30 days Overall leaderboard