Lightning-Flow-Scanner / lightning-flow-scanner-sfdx

A Salesforce CLI Plugin designed to pinpoint deviations from Industry Best Practices in Salesforce Flows, ensuring standards of business automation excellence.
https://www.npmjs.com/package/lightning-flow-scanner
GNU Affero General Public License v3.0
112 stars 12 forks source link

UnusedVariables false positive #40

Closed Damecek closed 1 year ago

Damecek commented 1 year ago

Hi, this rule UnusedVariables shows falsely a variable used inside the Filter element as an unused.

{
  "flowName": "Partner Portal: Lead Partner Reassign",
  "ruleName": "UnusedVariables",
  "description": "Removing unconnected variables which are not being used by the Flow makes your Flow more efficient and maintainable.",
  "details": {
    "name": "currentItem_Filter_Active",
    "type": "variables"
  }
},

and this is the usage of the variable

<collectionProcessors>
    <name>Filter_Active</name>
    <elementSubtype>FilterCollectionProcessor</elementSubtype>
    <label>Filter Active</label>
    <locationX>176</locationX>
    <locationY>518</locationY>
    <assignNextValueToReference>currentItem_Filter_Active</assignNextValueToReference>
    <collectionProcessorType>FilterCollectionProcessor</collectionProcessorType>
    <collectionReference>Get_Contacts</collectionReference>
    <conditionLogic>and</conditionLogic>
    <conditions>
        <leftValueReference>currentItem_Filter_Active.Experience_Site_Access__c</leftValueReference>
        <operator>Contains</operator>
        <rightValue>
            <stringValue>Partner_Community_Login_Partner_Portal</stringValue>
        </rightValue>
    </conditions>
    <connector>
        <targetReference>Reassign_Record</targetReference>
    </connector>
</collectionProcessors>
RubenHalman commented 1 year ago

Thank you. As it turns out collectionProcessors is part of the unofficial flow components. These are currently not supported. I will be looking into how much effort is required to support these components.