# Steps to create a Flow and add a Trigger

**Needs to be an intro to what we're having the users do.**

## Creating a Flow in Salesforce for Xoxoday Plum Reward Automation

**Before you get into creating your flows, you need to Create a Campaign and automation in Xoxoday Plum, Add the Xoxoday Refresh widget, and refresh it, to have all your old and new automation synced in.**&#x20;

{% content-ref url="getting-started-with-xoxoday-plum" %}
[getting-started-with-xoxoday-plum](https://xoxoday.gitbook.io/plum/user-guide/integrations/salesforce-+-plum/getting-started-with-xoxoday-plum)
{% endcontent-ref %}

<details>

<summary><a href="../getting-started-and-setting-up-salesforce-integration#adding-refresh-widget-for-automation"><strong>How to Add the Widget to the Homepage</strong></a></summary>

</details>

**Step 0:** Once you have added the widget click on **"Refresh".**

**Step 1:** On the homepage, Go to Navbar->Select Setup and Click on "Setup"

**Step 2:** On the Setup Dashboard, Search for **"Flows"** under Process Automation and Click on "New Flow".

**Step 3:** Now select the template type and Configure the Start Trigger Settings, Under Object: Select Lead/Contact and Click **"done".**

![](https://1597622271-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MOeXh7erUO5h_LVpN85%2Fuploads%2FwTWpcH3RuhFjzPdPUPee%2FScreenshot%202022-08-09%20at%203.50.10%20AM.png?alt=media\&token=067b95f3-dae3-4bd6-86f0-020b3e40cbb4)

**Step 4:** Now next step would be to add a new element: from options select "Create records".

![](https://1597622271-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MOeXh7erUO5h_LVpN85%2Fuploads%2F3qgCKBG6mfR1MMa6oozS%2FScreenshot%202022-08-09%20at%206.11.04%20PM.png?alt=media\&token=544f2dc0-30bd-4ca7-bd84-c62e4dbaa495)

**Step 5:** Edit the Create Records settings and under object look for "XoxodayRewardFlowAutomations" and then Click "Done". (refer to above image)

**Step 6:** Now add another element and Select "Get Records".&#x20;

**Step 7:** Edit the Get Records settings and under object look for "XoxodayRewardFlowAutomations" \
Once done, "Filter XoxodayRewardFlowAutomations Records" has to be updated.\
\- In fields select "id" \
\- In Values look for "Record (single) variables" ->Select your Xoxoday automation->Select "ID"

![](https://1597622271-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MOeXh7erUO5h_LVpN85%2Fuploads%2FVQUcbXVBtELpkvrlnjqv%2FScreenshot%202022-08-09%20at%206.39.55%20PM.png?alt=media\&token=07f56415-c7be-4c91-b0da-364296380f3e)

**Step 8:** Now the element that has to be added is "Action": Add element->Select Action->Uncategorised-> Action name: Xoxoday Plum Reward API.<br>

![](https://1597622271-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MOeXh7erUO5h_LVpN85%2Fuploads%2F19AHRglOKizGuvGq2aVB%2FScreenshot%202022-08-09%20at%206.29.29%20PM.png?alt=media\&token=11fd60af-91a8-494d-9ea9-171d64c0797e)

**Step 9:** Update Input fields as per your flow (refer below image)

![](https://1597622271-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MOeXh7erUO5h_LVpN85%2Fuploads%2FMIpE65LIC1j0m9FbPBK5%2FScreenshot%202022-08-09%20at%206.32.39%20PM.png?alt=media\&token=26d1a91f-66d2-4291-aef0-a20241619c8f)

![](https://1597622271-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MOeXh7erUO5h_LVpN85%2Fuploads%2FVbJixswDGcvAGYsv12XA%2FScreenshot%202022-08-09%20at%206.36.39%20PM.png?alt=media\&token=28443cdb-f5ce-4cb3-822b-116859a56739)

**Step 10:** Now **"Save"** your flow and **Activate** it.
