How to Automate Assets Creation using Flows in Salesforce

In Salesforce, Assets are the products or items an organization sells or uses to service customers. The Assets are associated with accounts, opportunities, or cases, providing information about the products owned or used by customers.

In Salesforce automation, we can automate the process of creating assets with the help of Salesforce flows, which results in saving time, reducing errors, and ensuring consistency.

Create a Flow Automate Assets Creation in Salesforce

To Automate Assets Creation using Flows in Salesforce, we will create a Record-triggered flow, and for that, navigate to the Setup page of Salesforce and follow the below steps.

1. On Salesforce’s Setup page, go to the Quick Find box and search, then select Flows under Process Automation.

2. On the Flows setup tab, click on the button New Flow.

3. Select the option Record-Triggered flow and click Create.

Create Asset Record with Flow in Salesforce

4. Now, we will configure the conditions to trigger the flow to run.

I have defined requirements such as when an opportunity is updated to closed won, the record will trigger, and I have configured the trigger accordingly.

  • Select the Object as Opportunity.
  • Under the heading Configure Trigger, select the option, A Record is Updated.
  • In the Conditions Requirements, enter the Field as Stage Name, Operator as Equals to, and Value as Closed Won.
Automate Asset Creation from Orders by Using Flows in Salesforce

5. Add a Get Record element to the flow and enter the following fields.

  • Enter the Label and the API name for the get record element.
  • Select the Object as an Opportunity Product.
  • In the Conditions Requirements, enter the Field as OpportunityId, Operator as Equals to, and Value as Record > Opportunity ID.
  • Under the heading How many records to store, select the option All records.
Use flow builder to create Assets in Salesforce

6. Now add a loop to the flow and add the below details to the loop element.

  • Enter the Label and the API Name.
  • In the field Collection Variable, select the created get the record element.
  • In the Direction field, select the option First item to the Last item.
Create Assets Using flows in Salesforce

7. Add an Assignment element in the loop and enter the Label and API Name for the assignment element. To create a variable, go to the Variable field and click on New Resource.

Add assets to an Account With Salesforce automation flow

8. Enter the below details for the new resource.

  • Select the Resource Type as a Variable.
  • API Name can be anything relevant to Asset; here, I have entered API Name as An_Asset.
  • Select the Data Type as Record and Object as Asset.
  • At last, click on the Done button.
Add assets to an Account in Salesforce using flows

9. We will set variable values using the created variable resource. In the section Set Variable Values, we will add the following variables to their respective fields.

See also  How to Call a Flow From Button in Salesforce | How to Launch Flow From Button in Salesforce
Variable Value
An_Asset > Account_IDRecord > Account > Account ID
An_Asset > Product_IDCurrent loop > Product > Product ID
An_Asset > QuantityCurrent loop > Quantity
An_Asset > Purchase DateRecord > Purchase Date
An_Asset > NameRecord > Account Name
Add assets to an Account record using flows in Salesforce

10. Again, add an Assignment element to make a collection of Assets in the record.

Enter the Label and the API Name for the assignment element, and I have labeled the second assignment element as Add asset to a collection.

To create a resource, in the field Variable click on New Resource.

How to automate asset creation in Salesforce

11. Enter the below details for the New Resource.

  • Select the Resource Type as a Variable.
  • For this resource, I have entered the API Name as Asset_collection.
  • Select the Data Type as Record and Object as Asset.
  • Activate the checkbox Allow multiple values and click on the Done button.
Create and update assets related to an order in Salesforce

12. In the section Set Variable Values, take the created Record variable, select Operator as Add, and Value as An_Asset ( variable from precious assignment element).

How to Automate Assets Creation using Flow in Salesforce

13. Add a Create Record element to create assets and

Asset Creation from a Closed Opportunity with a Flow in Salesforce

14. Save the flow, enter a relevant Flow Label and Flow API Name, and click the Save button.

Use Trigger Flow to Create Assets in Salesforce

15. At last, activate the flow and click on the Activate button.

How to create Assets in Salesforce account record using flow

After activation, the flow will start working, and it will trigger according to the defined conditions.

Test the Flow in the Salesforce console

To test and debug the flow, navigate to the Opportunity tab and follow the below steps.

1. In the Opportunity tab, open an opportunity record.

2. In the Opportunity record, set the stage to Closed Won.

Automate Asset Creation from Orders by Using Salesforce flow

As the stage is changed to closed won, the products in this opportunity will be added as assets to the opportunity’s account.

See also  How to Add Validation to Screen Flow in Salesforce

3. In the details section, click on the Account Name of the opportunity record.

Use Salesforce Flow to Automate Assets creation for account

4. In the account record, scroll to the section Assets and there you will see the products are added as assets in the account.

Add assets to an Account record in Salesforce using flows

If you are not able to view the Assets in the account record, then you have to edit the page layout, i.e., the Account page layout, and then add Assets from related lists to the page layouts.

In this way, we can automate asset creation using flows in Salesforce by following the Avobe steps.

Conclusion

In Salesforce, using Flows to create assets is a simple and effective way to automate asset creation processes. By following the above steps, we have understood the process of automating asset creation using the Salesforce trigger flow.

You may like to read: