---
schema_version: "1"
id: 9d1d7aff48c672100401cc8139039843fb66aeb5bbdbb0da187327b42eef169f
title: setActionFieldValues
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/platform/case_feed_dev_guide/guides/quickactions/quickaction-api-setactionfieldvalues.md
canonical_url: https://developer.salesforce.com/docs/platform/case-feed-dev-guide/guide/quickaction-api-setactionfieldvalues.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 3d0aac51ff2c3490469ac59ce71b03a7a66699bb4e5c1886a5cb48fdb9b0eba5
products:
  - Publisher and Quick Action Developer Guide
  - Platform Developer Content
---

# setActionFieldValues

Allows custom components to select a quick action on a record page and then specify field values for that action.

Because this method also selects the quick action, you don't need to use the `selectAction` method. To submit the quick action updates, pass `submitOnSuccess` as `true`.

## Arguments

|Name|Type|Description|
|----|----|-----------|
|actionName|string|The name of the quick action that you want to access.|
|parentFields|Object|Optional. The fields that you want to update on the current record. For example, if you want to set field values on the Email quick action on the case record page, the case object is the parent record.|
|targetFields|Object|The fields that you want to update on the quick action.|
|submitOnSuccess|boolean|Optional. Set to true if you want to save and submit the quick action after setting the field values. Default is false.|

The actionName parameter starts with the Salesforce object, followed by the quick action name. For example:

```nolang
actionName: "Case.UpdateCase"
```

The parentFields and targetFields objects contain a list of field names with values for each field. Each field can optionally specify the insertion behavior using the `insertType` key, which can be `replace` (default), `cursor`, or `begin`. For example:

```nolang
var parentFields = { Status: {value: "Closed"}, 
                     Subject: {value: "Case subject", insertType: "cursor"} }
var targetFields = { ToAddress: {value: "to@to.com"}, 
                     TextBody: {value: "the text body", insertType: "cursor"} }
```

We recommend that you don’t use this API with the following items:

-   Read-only fields
-   Encrypted fields
-   Fields within social actions

## Response

Returns a Promise. Success resolves to a response object. The Promise is rejected on error response.

```nolang
success: boolean,
actionName: "LogACall",
unavailableAction: boolean,
targetFieldErrors: [{
  Status: {message: "error"},
  Subject: {message: "error",
}],
errors: []

```

