# Get Scheduled Field from Heading

**URL:** <https://forum.dynamobim.com/t/get-scheduled-field-from-heading/52635>\
**Category:** Revit\
**Created:** [July 6, 2020, 12:37am UTC](https://forum.dynamobim.com/t/get-scheduled-field-from-heading/52635 "2020-07-06T00:37:20Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![paliitali](https://avatars.discourse-cdn.com/v4/letter/p/b782af/32.png) [@paliitali](https://forum.dynamobim.com/u/paliitali)\
**Post date:** [July 6, 2020, 12:37am UTC](https://forum.dynamobim.com/t/get-scheduled-field-from-heading/52635/1 "2020-07-06T00:37:20Z")

</div>

Hi all, I was wondering if it is possible to get the scheduled field (parameter name) from the heading?

For example:  
Scheduled field = “cooling capacity”  
Heading = “total cooling capacity (MBH)”  
Can I get the scheduled field “cooling capacity” from the heading “total cooling capacity (MBH)”?

Thanks

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [July 6, 2020, 1:54pm UTC](https://forum.dynamobim.com/t/get-scheduled-field-from-heading/52635/2 "2020-07-06T13:54:35Z")

</div>

I don’t think you can get it directly from the header but you do have a few options to get it from the schedule definition.  
[https://www.revitapidocs.com/2020/435e0f04-6cb4-c0f7-3ce7-61a6ad3cd7e6.htm](https://www.revitapidocs.com/2020/435e0f04-6cb4-c0f7-3ce7-61a6ad3cd7e6.htm)

---

<div class="post-metadata">

**Author:** ![paliitali](https://avatars.discourse-cdn.com/v4/letter/p/b782af/32.png) [@paliitali](https://forum.dynamobim.com/u/paliitali)\
**Post date:** [July 6, 2020, 11:32pm UTC](https://forum.dynamobim.com/t/get-scheduled-field-from-heading/52635/3 "2020-07-06T23:32:59Z")

</div>

script #1 will get all the scheduled fields from a specified schedule and script #2 will get the heading of all the scheduled fields from a specified schedule. I would appreciate if someone can help me edit script #1 to get the scheduled fields from the heading list from input 1 or for script #2 to get the heading from the scheduled field list from input 1. Thanks

Script #1

```
# Load the Python Standard and DesignScript Libraries
import sys
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

# Import DocumentManager and TransactionManager
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

# Import RevitAPI
clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *

doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application

from System.Collections.Generic import *

# Import ToDSType(bool) extension method
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)

# The inputs to this node will be stored as a list in the IN variable

schedule = UnwrapElement(IN[0])
colHeading = IN[1]

# Start the transaction
TransactionManager.Instance.EnsureInTransaction(doc)

definition = schedule.Definition
fieldOrder = definition.GetFieldOrder()

paramNames = [definition.GetField(i).GetName() for i in fieldOrder]

# End the transaction
TransactionManager.Instance.TransactionTaskDone()

# Assign your output to the OUT variable
OUT = paramNames

```

Script #2

```
# Load the Python Standard and DesignScript Libraries
import sys
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

# Import DocumentManager and TransactionManager
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

# Import RevitAPI
clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *

doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application

from System.Collections.Generic import *

# Import ToDSType(bool) extension method
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)

# The inputs to this node will be stored as a list in the IN variable

schedule = UnwrapElement(IN[0])
paramNames = IN[1]

# Start the transaction
TransactionManager.Instance.EnsureInTransaction(doc)

definition = schedule.Definition
fieldOrder = definition.GetFieldOrder()
colHeadings = [definition.GetField(i).ColumnHeading for i in fieldOrder]

# End the transaction
TransactionManager.Instance.TransactionTaskDone()

# Assign your output to the OUT variable
OUT = colHeadings
```

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [July 7, 2020, 1:28pm UTC](https://forum.dynamobim.com/t/get-scheduled-field-from-heading/52635/4 "2020-07-07T13:28:49Z")

</div>

Why do you need to use the header? Why can’t you get the parameter directly?  
My first suggestion would be to get the index of the header you’re looking for and then the item at that index from the list of parameters. (Just make sure no parameters are hidden when getting the index.)

---

<div class="post-metadata">

**Author:** ![paliitali](https://avatars.discourse-cdn.com/v4/letter/p/b782af/32.png) [@paliitali](https://forum.dynamobim.com/u/paliitali)\
**Post date:** [July 11, 2020, 4:34am UTC](https://forum.dynamobim.com/t/get-scheduled-field-from-heading/52635/5 "2020-07-11T04:34:15Z")

</div>

I need the header because this is the information that is imported from an excel schedule to revit.

I solved my problem by comparing excel headers to active view headers and then finding the parameter name.

---

<div class="post-metadata">

**Author:** ![d.kuurman](https://avatars.discourse-cdn.com/v4/letter/d/f1d935/32.png) [@d.kuurman](https://forum.dynamobim.com/u/d.kuurman)\
**Post date:** [July 11, 2020, 9:35am UTC](https://forum.dynamobim.com/t/get-scheduled-field-from-heading/52635/6 "2020-07-11T09:35:52Z")

</div>

If I remember correctly you can get the information that you’re looking for from the tableview class. That class contains all the information of how a schedule is shown in revit.

---

<div class="post-metadata">

**Author:** ![JustinStirling](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/justinstirling/32/79001_2.png) [@JustinStirling](https://forum.dynamobim.com/u/JustinStirling)\
**Post date:** [July 11, 2020, 11:10am UTC](https://forum.dynamobim.com/t/get-scheduled-field-from-heading/52635/7 "2020-07-11T11:10:34Z")

</div>

This may help lead you in the right direction…

> [@Reset Schedule Title and Heading Fonts](https://forum.dynamobim.com/t/reset-schedule-title-and-heading-fonts/51053/5):
>
> Hello the method [ScheduleField.ResetOverride()](https://www.revitapidocs.com/2018.2/accf7307-7f8f-3876-a478-09ffc96fd7ae.htm) is not suitable for this. it is necessary to apply an empty [TableCellStyle](https://www.revitapidocs.com/2018.2/2864c86d-c2e7-c891-0dcf-f8053c8d2eee.htm) object with method [SetCellStyle()](https://www.revitapidocs.com/2018.2/9bb8b594-60f3-6a65-5fc3-2445242ed300.htm) import clr clr.AddReference('ProtoGeometry') from Autodesk.DesignScript.Geometry import \* #import Revit API clr.AddReference('RevitAPI') import Autodesk from Autodesk.Revit.DB import \* clr.AddReference('RevitServices') import RevitServices from RevitServices.Persistence import DocumentManager from RevitServices.Transactions import Trans…
