Hello,
I am hoping to sort my Layout table element table_ele by the field "LABEL" but am unsure how to parameterize the function sortFields as shown in line 7. Any help would be appreciated. 🙂
mpf = arcpy.mp.ArcGISProject("CURRENT") # Select current map project
lyt = mpf.listLayouts(layout)[0] # Select layout
table_ele = lyt.listElements("MAPSURROUND_ELEMENT", "Table Frame")[0] # Search layout for first table frame
table_ele.sortFields()
The documentation says it's a list of dictionaries.
So I'd assume like
# Select current map project
mpf = arcpy.mp.ArcGISProject("CURRENT")
lyt = mpf.listLayouts(layout)[0] # Select layout
# Search layout for first table frame
table_ele = lyt.listElements("MAPSURROUND_ELEMENT", "Table Frame")[0]
table_ele.sortFields([{"name":"Label", "ascending": True, "caseSensitive": True},
{"name":"Field2", "ascending": False, "caseSensitive": True}
]
)