---
title: "SFDC Flows: Add Flow Variables"  
description: "In my previous post SFDC: Create an Approval Process, we learn how to create an approval process. Now we move to Flows and concentrate on each steps i"  
author: "Anonymous User"  
published: 2015-03-19  
updated: 2018-02-21  
canonical: https://www.mindstick.com/blog/10843/sfdc-flows-add-flow-variables  
category: "sales force"  
tags: ["cloud computing", "cloud", "cloud development", "sfdc", "dev-401"]  
reading_time: 2 minutes  

---

# SFDC Flows: Add Flow Variables

In my previous post [SFDC: Create an Approval Process](https://www.mindstick.com/blog/10841/SFDC%20Create%20an%20Approval%20Process#.VQqH0ly6bIU), we learn how to create an approval process. Now we move to Flows and concentrate on each steps in flow creation.

Visual Workflow enables us to build [applications](https://www.mindstick.com/articles/12847/how-to-choose-the-right-ethernet-cable-for-industrial-applications), [known as](https://answers.mindstick.com/qa/35703/ricky-ponting-is-also-known-as-what) flows, to guide users through screens for collecting and updating data. You can visually build flows using the drag-and-drop [user interface](https://www.mindstick.com/interview/22909/user-interface-objects-in-cocoa) of the Cloud Flow Designer. No coding required!

Here and in next few posts, we’ll create a simple flow that does the following each time it runs:

• Prompt the user for the line item information.

• Create the line item record for the invoice.

• Reduce the quantity of merchandise in stock by the quantity ordered in the line item.

##### Add Flow Variables

You can use flow [variables](https://www.mindstick.com/articles/715/php-variables) to store data that can be used throughout the flow and referenced as values for updating record fields. In this post, we’ll create two flow variables.

1. From Setup, click Create > Workflow & Approvals > Flows.

2. Click New Flow.

If prompted, activate the Adobe® Flash® plug-in.

3. Create the first [variable](https://www.mindstick.com/articles/1807/objective-c-data-types-variables-object-creation).

a. From the [Resources](https://yourviews.mindstick.com/view/293/renovation-causes-wastage-of-resources) tab, double-click Variable.

b. [Configure](https://answers.mindstick.com/qa/51511/how-to-configure-client-and-repository-in-informatica-power-center) the variable as follows.

Field Value

Unique Name vQuantityAvailable

Description Quantity of merchandise in stock.

Data Type Number

Scale 0

c. Click OK.

4. Create the second variable.

a. From the Resources tab, double-click Variable.

b. Configure the variable as follows.

Field Value

Unique Name vInvoiceId

Description ID of the invoice to which the flow adds the new line item. A

custom button on the Invoice detail page launches the flow

and passes the invoice ID into this variable.

Data Type Text

[Input and Output](https://www.mindstick.com/forum/161309/what-are-the-features-of-the-console-class-for-input-and-output-in-java) Input Only

This setting enables the variable to be set when the flow is launched by a custom

button

c. Click OK.

5. Click Explorer to verify the variables are saved.

![SFDC Flows: Add Flow Variables](https://www.mindstick.com/blogs/3b0d3447-e3f9-4dc2-af27-ec4d5177fb6c/images/a4e1418c-0df6-4464-bfd5-c4baa159968c.png)

6. Save the flow.

a. Click Save.

b. For the Name, enter Add Line Item from Invoice and Update Stock Quantity. The Unique Name is automatically populated based on this entry.

c. Click OK.

\

Ignore any activation warnings for now.

![SFDC Flows: Add Flow Variables](https://www.mindstick.com/blogs/3b0d3447-e3f9-4dc2-af27-ec4d5177fb6c/images/9c67906e-e32b-4278-9431-c55256b0e656.png)

Now we have created the variables for flow, next we add form screen for flow.

**This document is referred from [salesforce help tutorials](http://www.salesforce.com/us/developer/docs/workbook/index.htm)

---

Original Source: https://www.mindstick.com/blog/10843/sfdc-flows-add-flow-variables

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
