---
title: "valueForVariable(withName:)"
framework: automator
role: symbol
role_heading: Instance Method
path: "automator/amworkflow/valueforvariable(withname:)"
---

# valueForVariable(withName:)

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

## Declaration

```swift
func valueForVariable(withName variableName: String) -> Any?
```

## Parameters

- `variableName`: The variable name.

## Return Value

Return Value The value for the variable. Returns nil if no variable is found with the specified name.

## See Also

### Getting Information About a Workflow

- [actions](automator/amworkflow/actions.md)
- [fileURL](automator/amworkflow/fileurl.md)
