web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Copy One Field to Anot...
Power Apps
Unanswered

Copy One Field to Another Field

(0) ShareShare
ReportReport
Posted on by 764

I thought this would be simple.  I'm using an SQL Server connection to an on-premise server.  I have a Client form and I want to copy the Billing address to the Shipping address (attached).  I have a button to trigger copy (CopyBilling2Shipping).  In the OnSelect property of the button I have:

 

OnSelect = ShippingStreetVal.Text = BillingStreetVal.Text  (the Val fields are the datacard value fields).

 

I don't get any errors but nothing happens.  I'm sure there is a simple fix but I've looked around and can't find it.

 

CopyAddress.png

Categories:
I have the same question (0)
  • dinusc Profile Picture
    Microsoft Employee on at

    You cannot use simple assignments here as your "ShippingStreetVal.Text" is probably already bound to its parent card value.

    You can get some ideas of how this can be done from here:

    https://powerusers.microsoft.com/t5/Creating-Apps/How-to-enable-a-Same-as-Shipping-Billing-address-feature/m-p/117497#M2478

  • mogulman Profile Picture
    764 on at

    It did give me some ideas on how to solve.

     

    1. Used button to set context variable (copyB2S)

    2. In each datacard set Default to If(copyB2S, BillingStreetVar.Text,ThisItem.ShippingStreet)

    3. On save I refresh data if copyB2S is set and then unset.

    SubmitForm(ClientEditFM);If(copyB2S,Refresh('[dbo].[Client]'),false);UpdateContext({copyB2S:false})

  • v-xida-msft Profile Picture
    on at

    Hi @mogulman,

     

    Have you solved your problem?

     

    I have made a test on my side and please take a try with the following steps:

    • Set OnSelect property of CopyBilling2Shipping button control to following formula:

     

    UpdateContext({ButtonPress:true})

     

    • Unlock the DataCard where you want to show copied result.
    • Select the TextInput control within the above DataCard control, set Default property of this TextInput control to following formula:

     

    If(ButtonPress=true,BillingStreetVar.Text,Parent.Default)

     

    • Set OnSelect property of Submit button control to following formula:

     

    SubmitForm(ClientEditFM);If(ButtonPress=true,Refresh('[dbo].[Client]'),false);UpdateContext({ButtonPress:false})

     

    If you have solved your problem, please click "Accept as Solution" so that this thread will be marked for other users to easily identify if your problem is solved.

     

    Best regards,

    Kris

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard