Example 5: Flag injections if at least one compound is missing

  • Scope: Injection

  • Type: String

  • Find the MissingCompound function in the Injection node.

Formula

If(CurrentInjection.AllMissingCompounds.Count>=1, "missing","No Missing")

Alternatively, use a LINQ expression:

If(CurrentInjection.AllMissingCompounds.Any, "Flag","")

Alternative approach:

  • Scope: Injection

  • Type: Boolean

  • Formula: Count(Currentinjection.AllMissingCompounds)<>0

You can also create more elaborated formulas. For example, to return the number of missing compounds if any:

  • Scope: Injection

  • Type: String

  • Formula: If (Count(CurrentInjection.AllMissingCompounds) = 0, "No Calibrated Peak(s) Missing ", "Fail " &(Count(CurrentInjection.AllMissingCompounds) &" Calibrated Peak(s) Not Found "))

To return the names of the missing compounds if any:

  • Scope: Injection

  • Type: String

  • Formula: If (Count(CurrentInjection.AllMissingCompounds) = 0, "No Calibrated Peak(s) Missing ", "Fail " & string.join(" ",CurrentInjection.AllMissingCompounds.select(function(x) x.Compound_Name.tostring())))