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 / Update a Date coluum u...
Power Apps
Answered

Update a Date coluum using Patch fuction

(0) ShareShare
ReportReport
Posted on by 111

I need to change the DateColuum only when a certain option is selected.

In the code below I get the value of the combobox in a variable and then I try to insert it in the ID of that data

When I put the" varBoxAtm" variable in the Patch function, it is understood as a "Record" type and not as a Date".

 

If(comboBoxAtm.Selected.Value = "Foo";
Set(varBoxAtm; Now()));;

Patch(
 TBL_INFO;
 {
 DateColuum: {
 ID: emergencyGallery.Selected.ID;
 Value: varBoxAtm;
 } 
 
 }
);;

 

 

Categories:
  • Verified answer
    Liquid error: Exception has been thrown by the target of an invocation. RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @JasonCastro 

    Yes...you are setting the entire column to a record.  Your syntax is not correct.

    Please consider changing your Formula to the following:

    If(comboBoxAtm.Selected.Value = "Foo";
     Patch(TBL_INFO;
     {
     ID: emergencyGallery.Selected.ID;
     DateColuum: Now() 
     }
     )
    );;

    You don't need the variable to do this.  I took it out.  If you happen to need it elsewhere, just add it back.

     

    I hope this is helpful for you.

  • JasonCastro Profile Picture
    111 on at

    It's even better without using the IF, thanks!

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

    @JasonCastro 

    Excellent!

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 248 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 192 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard