If Else for capture

I have been wondering how to do the If Else as i didnt find any option for it.
By this i mean I want something like this:

var= availableProfiles

if data.Source has var:
(Put) SFA in capture
else:
(Put) NFA in capture

If unclear pls let me know as i dont understand seeing loli code so other threads not helping me as they answerded for loli code example.

IF STRINGKEY @data.SOURCE Contains @yourvariable
data.MarkForCapture(nameof(SFA));
ELSE
data.MarkForCapture(nameof(NFA));
END

where do i paste this? i mean cause i cant paste in C#

And what all things do i need to replace with mine except @yourvariable

can you tell how to do this in stacker?

u cant do it without lolicode
u have to paste this in lolicode

oh ok but it doesnt matter if i put this last right?

wherever u wanna use it is fine

You only need to replace yourvariable, SFA and NFA
It’s not possible to do this in stacker you HAVE to use the LoliCode section

[IDLE] CompilationErrorException: (111,74): error CS0103: The name ‘availableProfiles’ does not exist in the current context

???

availableProfiles is my @yourvariable

what am i supposed to replace nfa and sfa with as you said?

you literally said that, not me.

And if you cannot find the variable availableProfiles it means you set it inside an IF statement so it’s out of scope, just declare it at the start of the config using a constant block.

1 Like

how do i do that? …

You should really use the search function in this forum this has been asked maaaany times ^^