Cookie settings

Choose what this site may store in your browser. You can change it any time from Cookie settings at the bottom of every page.

Needed for the site to work Only remembers your cookie choice. Always on
Google Analytics counts visits and pages so we can improve the site.
Remembers the link or campaign that first brought you here, and sends it with our forms.
Coming soon to the Salesforce AppExchange

Deploy a Flow from VS Code

You copied a starter flow from the Flow loops post. Here's how to get that flow into your Salesforce org with VS Code and the Salesforce CLI. This is the developer path. If you'd rather not touch a code editor, follow the Screen Flow Guide: drop the component on a screen and set Config Name.

What this does: the copied XML is a ready-made Screen Flow that embeds the MultiDatePick component, already wired to a sensible set of objects and fields. You deploy it once, then rename a few API names to match your org. Total time is about 15 minutes the first time, a couple of minutes after that.

1. What you need

Three free tools. Install them once and you're set for every future deploy:

  • Visual Studio Code: the code editor.
  • Salesforce Extension Pack: adds the SFDX commands to VS Code. Install it from the Extensions panel (search "Salesforce Extension Pack").
  • Salesforce CLI (sf): the command-line tool the deploy runs through. Confirm it's installed by running sf version in VS Code's terminal.

2. One-time setup

Skip this section if you already work in an SFDX project connected to your org.

A Authorize your org

Connect VS Code to your Salesforce org. Open the Command Palette (Ctrl/Cmd + Shift + P) and run SFDX: Authorize an Org, or run this in the terminal:

sf org login web --alias myorg

A browser opens; log in and approve. Use a sandbox or Developer org first, not production.

B Open or create a project

If you have an SFDX project, open its folder in VS Code (File → Open Folder). If not, create one:

sf project generate --name multidatepick-flows
cd multidatepick-flows

Then open that folder in VS Code. You should see a force-app/main/default/ structure in the Explorer panel.

3. Import the copied XML

1 Create the flow file

In the Explorer, expand force-app/main/default/ and open (or create) the flows folder. Add a new file named after your flow, ending in .flow-meta.xml, for example On_Call_Rotation.flow-meta.xml. The name becomes the flow's API name, so use letters, numbers, and underscores only.

Or create it straight from VS Code's integrated terminal:

# Windows (PowerShell)
New-Item force-app/main/default/flows/On_Call_Rotation.flow-meta.xml -ItemType File -Force
# macOS / Linux
mkdir -p force-app/main/default/flows && touch force-app/main/default/flows/On_Call_Rotation.flow-meta.xml

2 Paste and save

Paste the starter flow XML you copied from the Flow loops post into the new file and save (Ctrl/Cmd + S).

3 Deploy to your org

Right-click the file in the Explorer and choose SFDX: Deploy Source to Org, or run this in the terminal:

sf project deploy start --source-dir force-app/main/default/flows/On_Call_Rotation.flow-meta.xml

Watch the Output panel for Deploy Succeeded. If it reports a field or object error, that's expected. The next step fixes it.

4. Finish in Flow Builder

4 Swap in your object and field names

In your org, go to Setup → Flows and open the flow you just deployed. Look for the elements and notes marked >>> UPDATE. Those point at the object and field API names the sample assumed. Change each one to match your own object, date field, and lookup. Then Save and Activate.

Now drop the flow on a page or a button, or run it directly, and users can start selecting dates.

Command recap:
sf org login web --alias myorg                 # authorize once
sf project generate --name multidatepick-flows  # only if you need a new project
sf project deploy start --source-dir force-app/main/default/flows/YOUR_FLOW.flow-meta.xml
Stuck on the CLI? Salesforce's CLI setup guide covers install and login in detail.

Flow deployed. What next?

See the components running in the live demo, learn the no-code Config Name path, or get notified the day MultiDatePick arrives on the Salesforce AppExchange.

Deploy error you can't place? Support@MultiDatePick.com

Get MultiDatePick feature updates

Five emails a year. Just the new features, nothing else.

Unsubscribe anytime