# Parameter

## *class* <mark style="color:purple;">Parameter</mark>

An interface for working with workflow parameters on Redivis. Parameters are used to store sets of values that can be referenced across transforms and notebooks in a workflow.

## Constructors

<table data-header-hidden><thead><tr><th width="368">Method</th><th>Description</th></tr></thead><tbody><tr><td><a href="redivis/redivisusdparameter"><strong><code>redivis$parameter</code></strong></a>(reference)</td><td>Create a reference to a parameter based on its (qualified) name</td></tr><tr><td><a href="workflow/workflowusdparameter"><strong><code>workflow$parameter</code></strong></a>(reference)</td><td>Reference a parameter within a specific workflow. </td></tr><tr><td><a href="workflow/workflowusdlist_parameters"><strong><code>Workflow$list_parameters</code></strong></a>()</td><td>Returns a list of Parameters within a workflow</td></tr></tbody></table>

## Examples

```r
param <- redivis$parameter("username.workflow_name.my_param")
param$create(values=list("foo","bar"))

print(param$get_values()) # list("foo", "bar")

param$update(values=list("foo","bar"))

print(param$get_values()) # values=list("hello","world")
```

## Attributes

<table data-header-hidden><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><strong><code>workflow</code></strong></td><td>A reference to the <a href="workflow">Workflow</a> instance that is associated with this parameter.</td></tr><tr><td><strong><code>properties</code></strong></td><td>A dict containing the <a href="../../../resource-definitions/parameter">API resource representation of the parameter</a>. This will only be populated after certain methods are called, particularly the <code>get</code> method, and will otherwise be <code>NULL</code>.</td></tr><tr><td><strong><code>qualified_reference</code></strong></td><td><p></p><p>The <a href="../../../referencing-resources">fully qualified reference</a> to this parameter</p><p>For example,</p><pre class="language-http"><code class="lang-http">imathews.example_workflow_climate_analysis:x7kh.my_param:27sa
</code></pre></td></tr><tr><td><strong><code>scoped_reference</code></strong></td><td>The canonical reference for the parameter, without any qualifiers. E.g., <code>my_param:27sa</code></td></tr></tbody></table>

## Methods

<table data-header-hidden><thead><tr><th width="368">Method</th><th>Description</th></tr></thead><tbody><tr><td><a href="parameter/parameterusdcreate"><strong><code>parameter$create</code></strong></a>(*, values, type)</td><td>Create a new parameter within a workflow.</td></tr><tr><td><a href="parameter/parameterusddelete"><strong><code>parameter$delete</code></strong></a>(*, values, type)</td><td>Delete a parameter</td></tr><tr><td><a href="parameter/parameterusdget"><strong><code>parameter$get</code></strong></a>()</td><td>Fetches the parameter, after which parameter.properties will contain a dict with entries corresponding to the properties on the <a href="../../../resource-definitions/parameter">parameter resource definition</a>. Will raise an error if the parameter does not exist.</td></tr><tr><td><a href="parameter/parameterusdget_values"><strong><code>parameter$get_values</code></strong></a>()</td><td>Fetches the list of values associated with the parameter.</td></tr><tr><td><a href="parameter/parameterusdexists"><strong><code>parameter$exists</code></strong></a>()</td><td>Check whether the parameter exists.</td></tr><tr><td><a href="parameter/parameterusdupdate"><strong><code>parameter$update</code></strong></a>([*, name, values, type])</td><td>Update the parameter's name, values, and/or type.</td></tr></tbody></table>
