Key Schedule Node doesn't overwrite excel data

Hi, I am having trouble getting this script to overwrite the data from Excel back to Revit Key Schedule. I am using the “Key Schedule Node”

It will write the data its the revit schedule is empty, But If I delete the schedule from revit, which it will lose the key that is assign to each door. So I dont want that…

Thanks in advance!
Dynamo Script File

Excel Data

Hi @boey1219 , welcome.

I had the same issue.

There is a workflow.

  1. Copy the Keyname to a dedicated parameter.
  2. Delete all the lines in the Key schedule (not the schedule itself)
    3.Re-import the values of the Key schedule.
    4.Using a dictionary, assign the Keynames again to the elements, using the dedicated parameter as your identifier.

Element.GetParamtervalueByName for Key schedules - Dynamo (dynamobim.com)

The graph is in the link.

Kind regards,

Willem