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 Apps - Building Power Apps
Unanswered

Marking a Task as complete via Patch()

(0) ShareShare
ReportReport
Posted on by 89

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?

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
    89 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
    89 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
    89 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
    89 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
    89 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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 686 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 433 Super User 2025 Season 2

#3
wolenberg_ Profile Picture

wolenberg_ 266 Moderator

Last 30 days Overall leaderboard