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 / Marking a Task as comp...
Power Apps
Unanswered

Marking a Task as complete via Patch()

(0) ShareShare
ReportReport
Posted on by 126

I'm trying to use Patch to mark a Task row as Completed, following this method:

 

Patch(Tasks,MyTask,{'Status Reason':'Status Reason (Tasks)'.Completed, 'Activity Status':'Activity Status (Tasks)'.Completed})

 

 

Instead, I get this error:

 

Error: Key statecode with type State/Microsoft.PowerFx.Types.OptionSetValueType is not supported yet.

 

 

I can use Patch to update another Task column of the Task. Any ideas on how to do so for the status columns?

Categories:
  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @Spinner ,

     

    As it is said in the solution, you need to update two columns statecode and status code at the same time:

    Patch(Tasks,MyTask,{statuscode:'Status Reason (Tasks)'.Completed, statecode:'Activity Status (Tasks)'.Completed})

     

    Best regards,

  • Spinner Profile Picture
    126 on at

    @v-jefferni  That's what I'm trying to do, as shown in my code above. Yet it fails with that error.

  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @Spinner ,

     

    I can use both your and my formulas to update the task status reason column with no problem:

    vjefferni_0-1710323200394.png

    vjefferni_1-1710323298947.png

     

    What's the variable MyTask? How does it get created?

     

    Best regards,

  • Spinner Profile Picture
    126 on at

    @v-jefferni  It's actually a placeholder to simplify the problem presented. My actual code contains a LookUp instead, as follows:

     

    Patch(Tasks,LookUp(Tasks,Task=GUID(TaskID)),{'Status Reason':'Status Reason (Tasks)'.Completed, 'Activity Status':'Activity Status (Tasks)'.Completed})

     

    The LookUp() call works elsewhere so I don't see it causing an issue here.

  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @Spinner ,

     

    Then what is TaskID? Where does it come from?

     

    Best regards,

  • Spinner Profile Picture
    126 on at

    It's the GUID of the Task record - the record's standard unique identifier.

  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @Spinner ,

     

    I still cannot reproduce this issue. Please consider raise a ticket on Power Platform Admin Center:

    Help + support | Power Platform admin center (microsoft.com)

     

    Best regards,

  • Spinner Profile Picture
    126 on at

    I wonder if it is linked to the fact that this is being done from a Card for PowerApps. The documentation does not seem to indicate that there is any restriction on how Patch() works but maybe there is a bug.

    chrome_ccwKcFdCUu.png

  • Spinner Profile Picture
    126 on at

    Hello @v-jefferni ,

     

    Does your code work in Cards for PowerApps as well as regular PowerApps?

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 221 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 188 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 120

Last 30 days Overall leaderboard