Flow Actions
Doc Management Flow Actions
Create Salesforce File
introduction the cloudfiles create salesforce file flow action enables you to copy a file from external storage into salesforce as a salesforce file ( content document ) this action uses the file's metadata details as input to identify and retrieve the external file once executed, the action generates a corresponding salesforce file, making it accessible and manageable within the salesforce environment the image below provides a visual representation of the action, showcasing its input and output parameters detailed descriptions of these parameters are provided in the sections that follow what this action does the cloudfiles create salesforce file flow action enables copying an external storage file (identified/specified by its metadata) into salesforce by creating a salesforce file ( content document ) of the external storage file for each such cloudfiles create salesforce file action execution, a content version created docid\ im asjotnofrrs9gvxvt5 event is triggered on successful creation of the salesforce file this action can be paired with other flow actions or elements to streamline processes such as bringing external storage files into salesforce for enhanced accessibility enabling these files to be used in salesforce based automations (e g , email workflows) allowing integration with external applications designed to work with salesforce files example use case suppose you've integrated external storage like sharepoint, where customer related files (e g , proposals, contracts) are stored in dedicated folders you want to automate the process of emailing a selected file to all related contacts file selection in a screen flow, present a list of file choices (e g , file names mapped to file ids) from the customer's folder input to action the selected file's metadata is passed into the 'create salesforce file' action, which imports it into salesforce as a salesforce file trigger cloudfilesevent flow the published 'content version created' event can link the file to the corresponding salesforce account using a content document link email automation in a subsequent flow, fetch the file and email it as an attachment to the related contacts this action provides a seamless way to bring external files into salesforce and leverage salesforce's robust automation capabilities input parameters let us discuss each of the input parameters in detail in the sections below drive id this is important for google drive & sharepoint libraries only the drive id is a unique identifier for a storage location in both sharepoint and google drive in sharepoint, it represents a document library within a site, while in google drive, it identifies a user's drive or shared drive you can get this parameter by viewing metadata details for a folder in the “content library” tab of cloudfiles app in salesforce or can be fetched through other flow actions like get connected folder library the library parameter is the external storage type you are using possible values are sharepoint , google (for google drive), onedrive , dropbox , box , cloudfiles (for aws s3) fileid this is the resource id of the target file you wish to bring into salesforce by creating a content document/salesforce file you can get this parameter through other flow actions like get resource details docid\ ue5s2y9qglsceiqd0serc or by filtering get folder contents docid 9mdumpjrzqenyvrixspbd record id the record id parameter is used to identify and manage the origin of a created salesforce file when a ' content version created' event is triggered purpose event identification helps distinguish the source of the event in scenarios where multiple flows use the same action for different objects or use cases content document linking enables creating a content document link to associate the salesforce file with a specific record key features flexible input you can input any text string, not just a record id event output whatever you input here will be available in the corresponding event details as parent id how it works input the record id of the relevant record into this parameter when the event is triggered, the record id is included in the event details in the platform event mode flow setup docid\ hbil pqlgbixyg81yse9g event triggered flow, retrieve the record id from the event details to filter and process further automations, such as linking the file to the record for example, if you want the created salesforce file to be associated with an account record , input the account's record id into this parameter in the event triggered flow fetch the record id from the event details use the content document link action to associate the created file with the account this parameter ensures traceability and flexibility in handling files across different flows and use cases you can use this parameter not just to input a record id but literally any text string whatever, you input into the action shall be output in the corresponding content version created docid\ im asjotnofrrs9gvxvt5 if you need to create salesforce files linked to a contact record but in two separate scenarios scenario 1 input "scenario1 contactrecordid" as the parameter scenario 2 input "scenario2 contactrecordid" as the parameter in the event triggered flow fetch the parameter value from the event details use it to identify the contact record id and differentiate between the two scenarios this approach allows you to retrieve the contact record id for further automation differentiate between events to handle specific actions based on the scenario output parameters the cloudfiles create salesforce file apex action does not return anything as an output in the flow it is used but for every scuccesful flow action execution or the salesforce file created a content version created docid\ im asjotnofrrs9gvxvt5 is published this event signals the completion of salesforce file/ contentdocument creation and can be used to trigger platform event flows to perform post creation actions if the action fails due to some reason, an error event event will be triggered and this event can be used in a decision element to diagnose and handle the error