How to force a variable being of type var

The node ScheduleFilter.ByFieldTypeAndValue has 3 input nodes, one of them being value which needs to be of type var.
ScheduleFilter.ByFieldTypeAndValue(field: ScheduleField, filterType:string, value:var): ScheduleFilter.
If I use a codeblock with code filtervalue: var =“Level 0”; this is still seen as a string and it it not accepted by the node ScheuldeFilter.ByFieldTypeAndValue.
How do I force the variable being of type var ?

Hello @leen.van.pelt

it’s indicated “var” because the values ​​can be of type, Integer, Double, String or ElementId (Element)


The problem was actually that the first parameter was wrong, schedulableField should be ScheduleField. But you also showed a good example of how to “convert” it, with x[3] in your code block. I used a List.FilterByBoolMask to filter out the proper one by name.
Now I’m stuck with the ScheduleView.AddFilters node, it doesn’t accept the Filter, although I can manually create this filter. I’ll create a seperate post for this problem.

1 Like