Posts

Showing posts with the label element

Salesforce Fact #931 | Performing aggregation using transform element

Image
We can perform aggregation operations as well using the transform element in flow. For this, we need to create an apex class with the AuraEnabled variables to store the aggregated value and refer the same in the transform element. This avoids the need for using loop. In this example, we are getting the sum of number of employees across all the accounts. Attached are the screenshots. Reference:  https://help.salesforce.com/s/articleView?id=platform.flow_build_logic_transform_sum_or_count.htm&type=5

Salesforce Fact #924 | Updating multi select lookup using screen action

Image
Suppose we have a datatable and multiselect lookup in screen flow. Now, whatever records are selected in the datatable should get selected in the lookup component. For this, we can make use of screen action. We can create a subflow which would take the list of selected records and extract the ids using a transform element and return those to the main flow. The returned ids can be selected as the input of the lookup. This would work instantly. In this example, we have an account lookup which is updated with the selected records of the datatable. Attached are the screenshots.

Salesforce Fact #9 | Flow tweak

Image
Suppose we have a use case: we have to update the description of certain account records daily and we are using auto-launched flow for this. Now, we have get records and update records element in auto launched flow which we can use for this scenario. So we may think like we will first fetch the records using a get records element and then we will iterate through each of the account record and populate the description field. And in the end, we will update the data using the same set of record which has been returned from get records element. But here is the tweak, if we have a use case where we are fetching the data in the flow, doing some modification and then have to update the same records, we cannot rely on the get records result set. We have to create one more collection variable and add each record in it once the description is updated. Also we have to use two separate assignment element one for updating the description of the current iterated record and the second ...