Getting The Content of Custom Widget in a Variable

Unfortunately, at the moment you can’t. See this topic for details.

Most likely, the closest alternative at the moment would be to have a parameter for your widget for the CSV, and then when calling the widget, you can put the CSV in an attribute using triple quotes """:

\widget $wdg.first(a: "test", csv)
Here you can access with the notation `<<csv>>`
\end $wdg.first

<$wdg.first a=120 csv="""
Comma Separated Values
Name, Age, Weight
Fariba, 23, 68
Ula, 37, 72
Shima, 19, 56
""" />