-
Notifications
You must be signed in to change notification settings - Fork 16
Closed
Description
I'd like to suggest adding a new rule ensuring Get Records elements retrieve only necessary fields.
Current Behaviour:
The scanner does not currently check if a Get Records element is configured using the "Automatically store all fields" option or 'Choose Fields' options', which can lead to unnecessary fields being queried and slow performance
Proposed Enhancement:
I propose adding a new rule named GetRecordsAllFields:
- Description: Detects Get Records elements configured with the "Automatically store all fields" option.
- Expected Behaviour: The scanner flags these elements with a
warning. - Justification: Retrieving all fields can negatively impact Flow performance, especially with objects having many fields, when dealing with large data volumes or querying non indexed fields. Best practice for SOQL and therefore Get Record element is to use selective filtering retrieving only the necessary fields for the Flow's logic to minimise resource consumption.
- Implementation Notes: Rule would need to check the specific property on the Get Records element metadata to see if fields are being queried or not. In the XML file and line will show if the 'Choose Fields' option is selected e.g.
<queriedFields>Id</queriedFields>. If "Automatically store all fields" is selected this line in the XML does not exist.
Purpose:
This rule focuses on improving query performance in Flow. By guiding users to be specific about the data they retrieve
Docs:
- SOQL and SOSL | Best Practices for Deployments with Large Data Volumes - https://developer.salesforce.com/docs/atlas.en-us.salesforce_large_data_volumes_bp.meta/salesforce_large_data_volumes_bp/ldv_deployments_best_practices_soql_and_sosl.htm
- Indexes | Best Practices - https://developer.salesforce.com/docs/atlas.en-us.salesforce_large_data_volumes_bp.meta/salesforce_large_data_volumes_bp/ldv_deployments_infrastructure_indexes.htm
Metadata
Metadata
Assignees
Labels
No labels