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 value from one co...
Power Apps
Unanswered

Copy value from one column to another column

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

hi Experts, 

i have following code to patch the record from pending column in sharepoint list. but when i approve it wont save the record but keep the record in the pending column.

below  all data card is from the pending. so i was patching monthly actual column with the value of pending column 

 

 

If(
 !IsBlank(varRecord.ModifiedBy) && varRecord.ActiveStatus.Value = "Active",
 Set(
 varRecord,
 Patch(
 Forecast,
 varRecord,
 {
 ApprovalStatus: "Approved",
 ActiveStatus: {Value: "Active"},
 Jan:Value(DataCardValue56.Text),//DatacardValue56 is the data card value of Jan pending 
 Feb:Value(DataCardValue60.Text),
 March:Value(DataCardValue61.Text),
 April:Value(DataCardValue62.Text),
 May:Value(DataCardValue63.Text),
 June:Value(DataCardValue64.Text),
 July:Value(DataCardValue65.Text),
 Aug:Value(DataCardValue66.Text),
 Sep:Value(DataCardValue67.Text),
 Oct:Value(DataCardValue68.Text),
 Nov:Value(DataCardValue70.Text),
 Dec:Value(DataCardValue71.Text),
 



 ModifiedBy: User().Email
 }
 )
 );

 

 

pokhani_0-1660913511352.pngpokhani_1-1660913525928.png

the main purpose of this was to simply copy the value frm pendig to actuals

pokhani_2-1660913663195.png

pokhani_1-1660913961926.png

 

 

please advise

 

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    Most likely it is not doing anything because you are trying to set the Modified By column.  That is a read only column in SharePoint.   So your Patch is most likely failing.

     

    Also, it appears that this is a Form...why a Patch?  You should be using SubmitForm on your form.

     

    I hope this is helpful for you.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    hi 

    i have follwoing scenario> 

    the app is basically updating monthly hours by PMS for all FTE. 

    so when they edit the existing list than for the record is saved to Jan pending. only after approval the jan pending data is transfered to the Jan colmn. 

    pokhani_0-1660918364273.png

    now coming to you question patch.

    if we submit the form than the existing record will be replaced with the new one. so 

    i saved the form to var record 

    Screen Editform: 

    when i submit the form

    the record is saved to pending so that existing record wont get modified unless approved. 

     

     

    pokhani_1-1660918814087.png

    now in approval screen approver will approve after reviewing so, whenver record is modified than the column modified by will get updated by the user who requested the update for the record. 

     

    now in approval screen any 

     

    pokhani_2-1660919007171.png

    in approval screen this record only get patched to the Month column from pending column if it gets approved. 

    there is no error and my record is not patching... thats the issue 

    pokhani_3-1660919888703.png

     

     

     

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    So still...you are (were) trying to patch the ModifiedBy column.  You cannot alter that column in your formula!

     

    As for the rest, I would strongly recommend using your form to do the logic you are showing rather than trying to do it all through a Patch...it's just more work that you don't need to do.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    i created another column modifiedbyemail and tried . but still the same output

     

    If(
     !IsBlank(varRecord.Modifiedbyemail) && varRecord.ActiveStatus.Value = "Active",
     Set(
     varRecord,
     Patch(
     Forecast,
     varRecord,
     {
     ApprovalStatus: "Approved",
     ActiveStatus: {Value: "Active"},
     Jan:Value(DataCardValue56.Text),
     Feb:Value(DataCardValue60.Text),
     March:Value(DataCardValue61.Text),
     April:Value(DataCardValue62.Text),
     May:Value(DataCardValue63.Text),
     June:Value(DataCardValue64.Text),
     July:Value(DataCardValue65.Text),
     Aug:Value(DataCardValue66.Text),
     Sep:Value(DataCardValue67.Text),
     Oct:Value(DataCardValue68.Text),
     Nov:Value(DataCardValue70.Text),
     Dec:Value(DataCardValue71.Text),
    
    
     Modifiedbyemail: User().Email
     }
     )
     );
     Office365Outlook.SendEmailV2(
     varRecord.Modifiedbyemail,
     "Approval for" & varRecord.EmployeeName & "'shas been approved",
     "Bummer. the Recrd is compliant:<br>",
     {Cc: varUser.Email}
     ),
     varRecord.ActiveStatus.Value = "Inactive",
     Patch(
     ResourceAdjustment,
     Defaults(ResourceAdjustment),
     {
     EmployeeID: varRecord.'EmployeeID (EmployeeID0)',
     EmployeeName: varRecord.EmployeeName,
     Role: varRecord.Role,
     ResourceType: varRecord.ResourceType,
     TerminationDate: varRecord.TerminationDate,
     DailyHours: varRecord.'Daily Hours',
     YearlyForecast: Value(varRecord.YearlyForecast),
     ActiveStatus: {Value: "Inactive"}
     }
     );
     Remove(
     Forecast,
     varRecord
     ),
     Set(
     varRecord,
     Patch(
     Forecast,
     varRecord,
     {
     ApprovalStatus: "Approved",
     ActiveStatus: {Value: "Active"}
     }
     )
     );
     Office365Outlook.SendEmailV2(
     varRecord.CreatedBy,
     "Approval for" & varRecord.EmployeeName & "'shas been approved",
     "Bummer. the Recrd is compliant:<br>",
     {Cc: varUser.Email}
     );
     Clear(colSelected);
     ClearCollect(
     colData,
     Forecast
     );
     ResetForm(Form1)
    );

     

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    It's hard to tell by just looking at that extremely long formula.  I would suggest using the monitor tool to determine exactly what is or is not happening in the formula.

     

    But still, this would be much easier by just put it in your form and using a SubmitForm to do the submitting.

    You could certainly do what you are mentioning quite easily in the Update properties of your datacards.

     

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

#2
11manish Profile Picture

11manish 181 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 112 Super User 2026 Season 2

Last 30 days Overall leaderboard