Create a schedule and fields using Field names

I have to make a number of schedules for different categories. All Schedules have the same fields. I have no problem creating the schedules. But I need to create them using the field names because the the fields have different index numbers depending on the category. Below is a snip from the routine. But the Index of is returning -1. I can’t figure out why. Anybody able to help

1 Like

@Donied ,

maybe you have to change the structure of your code

https://dictionary.dynamobim.com/#/BuiltIn/Action/IndexOf

-1 means None. It could be there is no value at this index

KR

Andreas

1 Like

Thanks. Any idea what I would change the code too

1 Like

Curious as to why you set the lacing to shortest. I have a similar script with lacing set to auto and don’t have any issues. Of course as to what @Draxl_Andreas has eluded to, if the field does not exist, then you will get -1 index return.

1 Like

I noticed your node is list indexof. Mine was indexof. So I upgraded my dynamo version and it works now. Thanks for you responses

1 Like