-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Variable falsely flagged as UnusedVariable when used in Text Templates #69
Comments
@filiprafalowicz thank you for getting involved. We will try to create a test for this and reproduce it. I'm just curious how you are using lightning flow scanner and which version? |
@RubenHalman I have added Lightning Flow Scanner as part of my PR validation pipeline and the project I am working on currently is heavily leveraging flows. This is why I have been reporting all of these issues / enhancements recently. I was using version |
@filiprafalowicz Thanks, I just wanted to make sure you are using the sfdx plugin. I think you are right on your initial analysis. l have created this PR as an initial starting point for this issue, which includes a new test case based on the flow you provided. |
@filiprafalowicz this has been resolved with version: "3.6.0", which I will soon publish in both the vsc and sf cli solutions |
When sending emails directly from the Flows, we need to very often use Text Templates resource which may use some formulas to dynamically generate email content based on the criteria. However for this scenario, lightning flow scanner will report UnusedVariable rule violation as Text Templates are not included in the logic that searches for variable usage.
Below is a sample flow that will trigger rule violation:
I think the issue is caused by
textTemplates
element being defined asflowMetadata
instead offlowVariables
in the Flow.ts file.The text was updated successfully, but these errors were encountered: