--- title: "Example 6: Save Relay Power-up Attachment to Salesforce" slug: "example-6-save-relay-power-up-attachment-to-salesforce" updated: 2025-01-15T17:51:52Z published: 2025-01-15T17:51:52Z canonical: "docs.relaynetwork.com/example-6-save-relay-power-up-attachment-to-salesforce" excludeFromExternalSearch: true --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.relaynetwork.com/llms.txt > Use this file to discover all available pages before exploring further. # Example 6: Save Relay Power-up Attachment to Salesforce ## Example 6: Save Relay Power-up File Attachment to Salesforce NOTE This example should be used as a reference to understand basic concepts and ideas on integrating with Relay Network. It should not be taken literally as this is how integration to Relay must be done. You should replace your record types, field names, business logic, etc. with those that match your business process and setup. ### Example Goals Whenever a user, in the Relay feed, attaches a file or image in a submitted Relay Power-up form, this flow will retrieve the attachment and store it in Salesforce. ### Assumptions - The user’s data is stored in a person account. - The person account has a custom field called **RelayCCID__c** that uniquely identifies the user. - A Relay Power-up form has been created and sent to a user ## Security and Permissions Record triggered flows always run in system context without sharing, which means they can access all data in the org regardless of user permissions, but still need the "Manage External Callouts" permission to make external calls ## Flow Resources This example does not require any flow resources to be created. ## Flow Logic ![](https://cdn.us.document360.io/6738087b-455d-402f-b70a-a44a4231547e/Images/Documentation/rn-sfdc-flow-example_6-diagram.png) ### (1) Create a Record-Triggered Flow - Specify the **RelayPowerups__c** record type - Set **Configure Trigger** as A record is created - Set the **Entry Conditions** to meet your specific business requirements. In this example, we will be looking for a specific form submission. - Set **Condition Requirements** to **All Conditions Are Met (AND)** - Add a condition: Field = Name; Operator = Equals; Value = “Powerups Data Artifact Available”. Enter the value without the quotes. ### (2) Add a Scheduled Path to the Flow The **RelayPullAttachmentAction** action in this flow makes an external callout, which cannot be run immediately in a record-triggered flow. To work around this, we will use a scheduled path to run the action asynchronously. - On the Flow Start element, add a **Scheduled Path**. ![](https://cdn.us.document360.io/6738087b-455d-402f-b70a-a44a4231547e/Images/Documentation/rn-sfdc-flow-example_6-scheduled_path.png) - Set the **Path Label** to *Delay* - Set the **API Name** to *Delay* - Set the **Time Source** to “*When RelayPowerups__c is Created*” - Set the **Offset Number** to *0* (so that it will run asynchronously, as soon as possible) - Set the **Offset Options** to *Minutes After* ![](https://cdn.us.document360.io/6738087b-455d-402f-b70a-a44a4231547e/Images/Documentation/rn-sfdc-flow-example_6-scheduled_path-settings.png) ### (3) Get the Person Account record > [!WARNING] > IMPORTANT > > This example assume the Person Account object has a custom **RelayCCID__c** field. You can use another field for the CCID value such as the records **ID** field. If you decide to use a different field, make sure you update the example flow accordingly and replace any instance of **RelayCCID__c** with the field you selected. - Add a **Get** **Records** element - Set the **Object** to *Account* - Set **Condition Requirements** to *All Conditions Are Met (AND)* - Set **Field** to *RelayCCID__c;* Set **Operator** to *Equals;* Set **Value** to *$Record > RelayCCID* - Set **How Many Records to Store** to *Only the first record* - Set **How to Store Record Data** to *Automatically store all fields* ![](https://cdn.us.document360.io/6738087b-455d-402f-b70a-a44a4231547e/Images/Documentation/rn-sfdc-flow-example_6-get-records.png) ### (4) Verify the Record was Retrieved - Add a **Decision** element - Set **Label** to *Did Find Account* - Set **API Name** to *Did_Find_Account* - Add a *Yes* outcome - Set **Label** to*Yes* - Set **Outcome API Name** to *Yes* - Set **Condition Requirements to Execute Outcome** to *All Conditions Are Met (AND)* - Set **Resource=***Account from Get Account;* ***Operator=****Is Null*; **Value**=*False* - Change the default outcome label to *No* ![](https://cdn.us.document360.io/6738087b-455d-402f-b70a-a44a4231547e/Images/Documentation/rn-sfdc-flow-example_6-did-get-record.png) ### (5) Add a RelayPullAttachmentAction to the Flow This Relay action will pull the attachment into your Salesforce org and automatically store the attachment as a **File** associated with the account record of the ID retrieved in step (2). - Edit the **RelayPullAttaachmentAction** element properties - Set **Label** to Pull Attachement - Set API Name to Pull_Attachment - Set **RelayPowerups__c event** to the event record that triggered the flow; *Triggering RelayPowerups__c* - Set **Description** to *Relay Powerup Form* - Set **Linked Entity Id** to *Account from Get Account → Account ID.* - Set **Title** to the attachment file name. e.g. Insurance Card. The business **feed** is a new, personalized business to consumer channel that offers the rich usability and familiarity of scrolling feeds with the timeliness of SMS texting. The feed is a mobile web application that requires no app downloads. ## Related - [Relay Pull Attachment Action](/relay-pull-attachment-action.md)