---
title: "setValue(_:forVariableWithName:)"
framework: automator
role: symbol
role_heading: Instance Method
path: "automator/amworkflow/setvalue(_:forvariablewithname:)"
---

# setValue(_:forVariableWithName:)

Sets the value of the workflow variable with the specified name.

## Declaration

```swift
func setValue(_ value: Any?, forVariableWithName variableName: String) -> Bool
```

## Parameters

- `value`: The value to set for the named variable.
- `variableName`: The name of a variable to set the value for.

## Return Value

Return Value true if variableName was found and its value is set; otherwise false.

## Discussion

Discussion This method does nothing if the variable specified by variableName is not found.
