I am able to add other filters using the same nodes and inputs without issue, but “Has Parameter” (Parameter exists, in Revit’s schedule) returns an error: “Filter value is not valid for the field and filter type”
The parameter in question is a shared text parameter, if that matters.
Anyone have experience adding Parameter Exists filters using dynamo?
Hi Devlyn, welcome 
The API docs note the following
‘The element has the parameter specified by the field. Used with shared parameters. No value is specified for this filter type.’
However - I think this is a source code issue as the constructor for the filter does not consider the case for HasParameter, HasValue, HasNoValue where there is no value input as this returns a function from the node. Further if you try null or "" or 0.0 it still errors. An ElementId.InvalidElementId and Int64 0 didn’t even make it as they could not be cast to a Dynamo element
tl;dr It’s not working at a code level
I will put in a new issue at the GitHub repo to get this reviewed
Here’s some code to get you across the gap - please note there is also an issue with the SheduleFilter.ByFieldTypeAndValue with integers
Edit: Hot tip! Use in manual mode, otherwise it will add multiple filters
import clr
clr.AddReference("RevitNodes")
import Revit
clr.AddReference("RevitServices")
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
clr.AddReference("RevitAPI")
from Autodesk.Revit.DB import *
from System import Int32, Int64
def to_list(items):
if isinstance(items, list):
return items
return [items]
doc = DocumentManager.Instance.CurrentDBDocument
schedule_view = UnwrapElement(IN[0])
schedule_filters = to_list(IN[1])
TransactionManager.Instance.EnsureInTransaction(doc)
for sf in schedule_filters:
new_sf = ScheduleFilter(ScheduleFieldId(sf.FiledId), eval("ScheduleFilterType." + sf.FilterType))
value = sf.Value
if sf.FilterType in ["HasNoValue", "HasParameter", "HasValue"]:
new_sf.SetNullValue()
elif isinstance(value, (int, Int32, Int64)):
new_sf.SetValue(Int32(value))
elif isinstance(value, str):
new_sf.SetValue(value)
elif isinstance(value, Revit.Elements.Element):
new_sf.SetValue(UnwrapElement(value).Id)
else:
continue
schedule_view.Definition.AddFilter(new_sf)
TransactionManager.Instance.TransactionTaskDone()
OUT = schedule_view
2 Likes