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 / Patch conditional columns
Power Apps
Suggested Answer

Patch conditional columns

(2) ShareShare
ReportReport
Posted on by 47
If(
    CountRows(colErrors) = 0,
 
    With(
        {
            patchRecord:
                Patch(
                    {
                        // ✅ ALWAYS FIELDS
                        ProcessedBy: vObj.flowProcesState.ProcessedByApp,
                        FlowProcessState: vObj.flowProcesState.ToProcess
                   
                       
 
                       
                    },
 
                    // ✅ 1st Approver
                   
                    If(
                        CountRows(Filter(varChangedOnly, Column="FirstApproverDecision")) > 0,
                        {
                            FirstApproverDecision: var1stDecision,
                            DecisionDate1App: Now()
                        },
                        {}
                    ), 
 
  Set(tpatch,patchRecord);
 
 IfError(
            Set(
                vRecordViewWEdit,
                Patch(
                    SPlist,
                    LookUp(SPlist, ID = vRecordViewWEdit.ID),
                    patchRecord
                )
            );
 
           
Patch is working, but when i want to debug i cant see this conditional columns in variable why? allways i see only
ProcessedBy: And FlowProcessState: even if contion is true for FirstApproverDecision  but patch is patching correctly when condition is true... how im able to see this conditional column??
"Thank you for every piece of advice."!!
       
Categories:
I have the same question (0)
  • Suggested answer
    11manish Profile Picture
    3,347 on at
    Since the SharePoint Patch succeeds, your logic is correct. The issue is only with the debugger's visualization of dynamically merged records.

    For debugging, I recommend:

    Set(varPatchJson, JSON(patchRecord, JSONFormat.IndentFour))

    This is the easiest and most reliable way to inspect the exact contents of patchRecord, including all conditional fields.
  • Suggested answer
    Valantis Profile Picture
    6,778 on at
     
    To actually see the conditional fields, capture the Patch result itself:

    Set(debugResult, Patch(SPlist, LookUp(...), patchRecord, If(condition, {...}, {})))
     
    Then JSON(debugResult) will show everything that was written, including the conditional columns. debugResult comes back as the full updated SharePoint record.
     
      Best regards,

    Valantis   ✅ If this helped solve your issue, please Accept as Solution so others can find it quickly.

    ❤️ If it didn’t fully solve it but was still useful, please click “Yes” on “Was this reply helpful?” or leave a Like :).

    🏷️ For follow-ups  @Valantis.

    📝 https://valantisond365.com/ 💼 LinkedIn ▶️ YouTube

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
WarrenBelz Profile Picture

WarrenBelz 347 Most Valuable Professional

#2
Valantis Profile Picture

Valantis 256

#3
11manish Profile Picture

11manish 245

Last 30 days Overall leaderboard