---
schema_version: "1"
id: 24bdad6c76bb9c6445fe846e760c24386b9cc76b7454210d07d826980c0eba9b
title: Referral Codes Generation Using Flow
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/xcloud/264-0-0/member_referral_code_generate_flow.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.member_referral_code_generate_flow.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: cb1c84c8871ba67639b0d0af7f59eb27192c29313eab79efc7efaa4cd5f4dacb
description: The Generate Member Referral Code flow action allows admins to set up a process to generate referral codes for members. Admins can set up a one-time process to generate referral codes for members who don’t have a referral code. Or, set up a process to regenerate referral codes either based on a customer request or based on the program’s requirements.
products:
  - Loyalty Management
release: "264"
---
# Referral Codes Generation Using Flow

The Generate Member Referral Code flow action allows admins to set up a process to generate referral codes for members. Admins can set up a one-time process to generate referral codes for members who don’t have a referral code. Or, set up a process to regenerate referral codes either based on a customer request or based on the program’s requirements.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: Lightning Experience</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>Enterprise</strong>,&nbsp;<strong>Performance</strong>, <strong>Unlimited</strong>, and&nbsp;<strong>Developer</strong>&nbsp;Editions with Loyalty Management</td></tr></tbody></table>

In the Generate Member Referral Code flow action, you have to specify only the ID of the Loyalty Program Member record for which a referral code is to be generated. When the flow runs the action, the action generates a referral code for the member and adds it to the Referral Code field in the specified Loyalty Program Member record. If the member already has a referral code, the referral code generated by the action overwrites the existing referral code.

![Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-loyalty_management-264-0-0-production-enus/0590ce3e-5a09-45ab-8e5e-68f359c35886/images/icon_example.png)

Example A company wants to generate a referral code for any member who doesn’t have a referral code yet and also wants to set up a process to regenerate referral codes for members every two years. The company’s admin can set up two flows. One flow finds the members who don’t have a referral code and uses the Generate Member Referral Code action to generate referral codes for them. The other flow is a scheduled flow that runs every two years to generate new referral codes for all active members.