Objective:
This article shows you a sample implementation of Youreka where Form records are created using screen flows.
Before you get started:
These articles might be helpful before you read this one:
Form records are just like any other record in Salesforce. This means that they can be created using all of the great tools that Salesforce offers us for inserting records into the database. This includes quick actions, standard actions, declarative automation, apex, and more. One interesting way of creating Form records can be by using Salesforce Screen Flows. The benefit of doing this is that you can create custom user interfaces for generating one, or perhaps several form records. The GIFs below show you some examples.
Example Use Case
Suppose you had a custom object in your Salesforce environment called Property (Property__c). As part of your implementation, you intend to have end users fill out Forms which are linked to Property records. For one reason or another, you feel as though it's important for end users to be able to create Forms directly from the Property record page. Here are some things you might consider:
- The standard New Form button on the Forms related list. The benefit here is that it is out-of-box, and a fairly simple interface. The downside to this approach is that your form lookups are not pre-populated.
- Custom buttons - Custom buttons would allow you to create and launch new form records, and pre-populate lookups.
- Youreka Lightning Components - Youreka's Lightning Components would let you create a streamlined user experience, pre-populate Form lookups, and even fill out the forms while still on the Property record page. The downside is that the user experience cannot be customized, and template selection is limited (you would need a separate button for each type of Form Template).
- Screen Flows - Screen flows are great because they allow you to completely customize the user experience! They do have drawbacks, which we will discuss later in this article, but if you're looking for a way to easily pre-populate record IDs, design your own end user experience, and automate beyond Form creation, this option is great for you!
Building Out A Screen Flow
If you decide to use the Screen Flow option, you must create a Screen Flow in Salesforce setup. Your flow will be unique to your use case, but here's an example that we've created.
Some key aspects to the screen flow are:
- We began with a screen element, that allows the end user to select a Form Template (using a lookup element), as well as the Form Owner.
- The Owner lookup technically utilizes the Originally Submitted By user lookup on the Form object, because the standard Owner ID attribute is not available in flow lookups.
- After the screen element, we use a Create Record element to create a Form record. We use the Form Template ID that was selected by the end user, as well as the User ID that was selected to populate the Owner ID field. Finally, we automatically populate the Property lookup field on the newly created form object by using the recordId that is naturally brought in when launching a Flow from a quick action.
- We then created a Quick Action that launches the flow. After creating, we added the Quick Action to the Property page layout.
- The final result is that the end user can click on the Quick Action, select a Form Template and Owner, and the Form record is created.
Considerations For Using Screen Flows For Form Creation
- Screen Flow are less flexible that the standard New Form visualforce page that comes out-of-box with Youreka. Because of this, you must anticipate any Form Lookups that will be necessary for any given Form Template that you select. Remember, if you attempt to create a Form record without populating the necessary Form Lookups, the end user will experience an error.
- Lookups are just one way to offer end users the ability to pick a Form Template. You might also decide to use the standard Record Choice element in Flow. Additionally, we've seen people use custom Lightning Components that display a subset of Form Templates to end users, which naturally limits an end user's Form Template options.
Depending on your use case and requirements, your screen flows could be far different than the ones demonstrated here. In any case, the lesson here is that Screen Flows can be a great option for giving end users a customized user interface for quickly and efficiently creating Form records.
Comments
0 comments
Article is closed for comments.