web
You’re offline. This is a read only version of the page.
close
Skip to main content
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 101

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:
I have the same question (0)
  • v-jefferni Profile Picture
    on at
    Re: Marking a Task as complete via Patch()

    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
    101 on at
    Re: Marking a Task as complete via Patch()

    @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
    on at
    Re: Marking a Task as complete via Patch()

    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
    101 on at
    Re: Marking a Task as complete via Patch()

    @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
    on at
    Re: Marking a Task as complete via Patch()

    Hi @Spinner ,

     

    Then what is TaskID? Where does it come from?

     

    Best regards,

  • Spinner Profile Picture
    101 on at
    Re: Marking a Task as complete via Patch()

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

  • v-jefferni Profile Picture
    on at
    Re: Marking a Task as complete via Patch()

    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
    101 on at
    Re: Marking a Task as complete via Patch()

    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
    101 on at
    Re: Marking a Task as complete via Patch()

    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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 836 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 231 Super User 2025 Season 2

Last 30 days Overall leaderboard