Id warnings error when exporting to excel

Good morning everyone.
I have the following problem, I have obtained the warning IDs of my document and I want to export them to Excel but that data is not exported, Excel opens but the data is not displayed, why???

import clr

clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
import Autodesk.Revit.DB as DB
import Autodesk.Revit.DB.Structure as DBS
from Autodesk.Revit.DB.Structure import *
from Autodesk.Revit.DB import BuiltInCategory

clr.AddReference('RevitAPIUI')
from Autodesk.Revit.UI import *
from Autodesk.Revit.UI.Selection import *

clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
clr.ImportExtensions(Revit.Elements)

clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

doc = DocumentManager.Instance.CurrentDBDocument
uidoc=DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument

link_instances = FilteredElementCollector(doc).OfClass(RevitLinkInstance).ToElements()

def aplanar_lista(lista):
	resultado = []
	for item in lista:
		if isinstance(item, list):
			resultado.extend(aplanar_lista(item))
		else:
			resultado.append(item)
	return resultado
#----------------------------------------
ColectorWarning = doc.GetWarnings()

IdElem_Warning = []
Cantidad_Warning = []

for w in ColectorWarning:
	elem = w.GetFailingElements()	
	dato = []
	for e in elem:
		valor = str(e.IntegerValue)
		dato.append(valor)
		
	elem_aplan = aplanar_lista(elem)
	concatenado = " y ".join(map(str, elem_aplan))	
	IdElem_Warning.append(concatenado)	
	Cantidad_Warning.append(len(elem))
	
OUT = IdElem_Warning

problemas_warning.dyn (10.9 KB)

Data structure is flat. Excel generally needs a list of lists of data.

Good morning.
Yes I understand, but I have tried with Cantidad_Warning.append(len(elem)) , and it exports correctly ,I don’t know why that happens with those ids… could you please help me solve it?

Try changing the last line to:
OUT = [IdElem_Warning]

I have made the change and it has not worked.
I forgot to mention that I am working within Dynamo 2.7 in Revit 2020

I can’t even get that version installed, so hard to help directly. :face_with_diagonal_mouth: Best to upgrade if you can, and there aren’t many (any?) reasons you can’t other than someone else won’t let you. Be sure to forward your cyber insurance premium for reimbursement due to the continued use of unsupported software 2.75 years after it’s expiration date…

The code you provided runs perfectly fine for me in 2022 (as far back as I have available). Might want to try a different write out method - does CSV give you better results if you change the line IdElem_Warning.append(concatenado) to IdElem_Warning.append([concatenado])? If so the CSV can then be opened in excel, or linked into another Excel file or dashboard as you would any other excel export.

It does seem like it could be a version issue - maybe incompatibility between the API version in the node and the version of Excel you have installed. What happens if you use List.Chop with length 1 to supply Excel with the appropriate list structure?