# 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/redivis.parameter"><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/workflow.parameter"><strong><code>workflow.parameter</code></strong></a>(reference)</td><td>Reference a parameter within a specific <a href="workflow">workflow</a>. </td></tr><tr><td><a href="workflow/workflow.list_parameters"><strong><code>Workflow.list_parameters</code></strong></a>()</td><td>Returns a list of Parameters within a workflow</td></tr></tbody></table>

## Examples

<pre class="language-python"><code class="lang-python">import redivis

workflow = redivis.workflow("username.workflow_name")
parameter = workflow.parameter("my_param").create(values=["foo","bar"])

<strong>print(parameter.get_values()) # ["foo", "bar"]
</strong>
parameter.update(values=["hello","world"])

print(parameter.get_values()) # ["hello", "world"]
</code></pre>

## 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>None</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/parameter.create"><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/parameter.delete"><strong><code>parameter.delete</code></strong></a>(*, values, type)</td><td>Delete a parameter</td></tr><tr><td><a href="parameter/parameter.get"><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/parameter.get"><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/parameter.exists"><strong><code>parameter.exists</code></strong></a>()</td><td>Check whether the parameter exists.</td></tr><tr><td><a href="parameter/parameter.update"><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>
