---
title: "setEvent(atIndexPath:isComplete:completion:)"
framework: CareKit
role: symbol
role_heading: Instance Method
platforms: [iOS 13.0+, Mac Catalyst 13.0+, watchOS 7.0+]
path: "carekit/ocktaskcontrollerprotocol/setevent(atindexpath:iscomplete:completion:)-11kln"
---

# setEvent(atIndexPath:isComplete:completion:)

Sets a specific event for a task view controller, and creates an outcome value if the task is complete.

## Declaration

```swift
func setEvent(atIndexPath indexPath: IndexPath, isComplete: Bool, completion: ((Result<OCKAnyOutcome, Error>) -> Void)?)
```

## Parameters

- `indexPath  `: The position in the task collection view.
- `isComplete`: A Boolean value that indicates whether the event is compete. If you pass true, this function will create an outcome and save it to the store.
- `completion `: A completion handler the function calls when it is done.

## See Also

### Handling Task Selection

- [appendOutcomeValue(withType:at:completion:)](carekit/ocktaskcontrollerprotocol/appendoutcomevalue(withtype:at:completion:)-3est6.md)
- [eventFor(indexPath:)](carekit/ocktaskcontrollerprotocol/eventfor(indexpath:)-6lqed.md)
- [makeOutcomeFor(event:withValues:)](carekit/ocktaskcontrollerprotocol/makeoutcomefor(event:withvalues:)-4sb0b.md)
- [initiateDeletionForOutcomeValue(atIndex:eventIndexPath:deletionCompletion:)](carekit/ocktaskcontrollerprotocol/initiatedeletionforoutcomevalue(atindex:eventindexpath:deletioncompletion:)-4hoy0.md)
- [initiateDetailsViewController(forIndexPath:)](carekit/ocktaskcontrollerprotocol/initiatedetailsviewcontroller(forindexpath:)-5gptc.md)
