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 text from one fie...
Power Apps
Suggested Answer

Copy text from one field to another on form submit

(0) ShareShare
ReportReport
Posted on by 89
I have 2 text fields (Actual Behavior and Expected Behavior). These are multiline text fields. On the NewIntake_Form, the user will enter a text summary in each field. Both fields are marked as required.  After the new intake is created, the team can update the information in both of these text fields on the Details_Form.
 
The goal is to have whatever information is entered into these 2 fields, at the time of creation, to copy over to a secondary field (Original Actual Behavior, Original Expected Behavior).  Then, the Original Actual Behavior and Original Expected behavior fields are View Only when the user or team is viewing the entry on the  Details.Form and will not update if the Actual Behavior and Expected Behavior fields are updated.  The purpose is so that management / auditors can see what was originally entered at creation and compare it to the final information in those fields once the intake is completed. 
 
I have the Actual Behavior and Expected Behavior fields on the NewIntake_Form, visible, and in edit mode. 
I also have the Original Actual Behavior and Original Expected Behavior fields on the NewIntake_Form, in edit mode, but hidden. 
The update property for the Original Actual Behavior field is set to the below, with DataCardValue27 = the data card text  value of the Actual Behavior field. If (NewIntake_Form.Mode=FormMode.New, DataCardValue27.Text, ThisItem.OriginalActualBehaviorSeen)
The update property for the Original Expected Behavior field is set to the below, with DataCardValue28 = the data card text  value of the Expected Behavior field. If (NewIntake_Form.Mode=FormMode.New, DataCardValue28.Text, ThisItem.OriginalExpectedBehaviorSeen)
 
Majority of the time, the Original fields are updating as expected and can be viewed on the Details_Form, and are NOT updated when the Actual Behavior or Expected Behavior fields are updated. Randomly, the Original fields do not populate at the time of creation (i.e., NewIntake_Form is submitted).  I have to assume that maybe it's a SharePoint glitch and the fields aren't updating... but it seems strange the that entries before and after are fine.  I have 3 examples from the past 2 days.  Any suggestions?
Categories:
I have the same question (0)
  • Suggested answer
    Kalathiya Profile Picture
    2,456 Super User 2026 Season 1 on at
    Hello @pandalove19,
     
    You can try below approach: 
     
    Submit or Save Button:
    Collect the form mode before submitting:
    UpdateContext({_IsNewForm:If(NewIntake_Form.Mode = FormMode.New,ture,false)});
     
     
    Update formulas, capture the original values after the record is created:
     
    Form OnSuccess Property: 
    UpdateContext({_lastSubmittedRecord:Self.LastSubmit});
    If(
        NewIntake_Form.Mode = FormMode.New, //If it's not work please use _IsNewForm variable
        Patch(
            YourList, //YourList - Replace with your table or list name
            _lastSubmittedRecord,
            {
                OriginalActualBehaviorSeen: _lastSubmittedRecord.ActualBehavior,
                OriginalExpectedBehaviorSeen: _lastSubmittedRecord.ExpectedBehavior
            }
        )
    )
      
    Note: "OriginalActualBehaviorSeen","ActualBehavior","OriginalExpectedBehaviorSeen" and "ExpectedBehavior" replace this all column names as per your table or list name.
     
     
    If this response resolves your issue, please mark it as the Verified Answer so it can help other community members as well.
    ---------------------------------------------------------------------------------
     
    📩 Need more help? Mention @Kalathiya anytime!
    ✔️ Don’t forget to Accept as Solution if this guidance worked for you.
    💛 Your Like motivates me to keep helping!
    ​​​​​
     
  • WarrenBelz Profile Picture
    155,838 Most Valuable Professional on at
    I will add something here to @Kalathiya's solution as there is one small issue - OnSuccess of a Form cannot detect what Mode the form was in before submitting. So when the form is submitted, add a Variable before the submission
    UpdateContext({varNew: YourFormName.Mode = FormMode.New});
    SubmitForm(YourFormName)
    Now OnSuccess
    If(
       varNew,
       Patch(
          YourListName,
          Self.LastSubmit,
          {
             OriginalActualBehaviorSeen: Self.LastSubmit.ActualBehavior,
             OriginalExpectedBehaviorSeen: Self.LastSubmit.ExpectedBehavior
          }
       );
       UpdateContext({varNew: false})
    )
     
    Please Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider answering Yes to Was this reply helpful? or give it a Like
    Visit my blog
    Practical Power Apps    LinkedIn  
  • WarrenBelz Profile Picture
    155,838 Most Valuable Professional on at
    A quick follow-up to see if you received the answer you were looking for. Happy to assist further if not.
     
    Please Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider answering Yes to Was this reply helpful? or give it a Like ♥
    Visit my blog
    Practical Power Apps    LinkedIn   

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 424

#2
WarrenBelz Profile Picture

WarrenBelz 355 Most Valuable Professional

#3
11manish Profile Picture

11manish 290

Last 30 days Overall leaderboard