Export CSV as Data Values

How do I export a tiddler to csv, where the exported csv has the actual filter query results?

This is my tiddler: https://chatgpt-conversations.tiddlyhost.com/#chatgpt-conversations-csv

(this was also asked in an old question: [tw5] Exporting Content to CSV). I sense it should be really easy to do, like a setting or something like that…

Thanks,

//steve.

Well, I found a partial solution that involves iterating through the tiddlers, and generating another one with the desired fields. I can’t quite get it to iterate on its one, though.

https://chatgpt-conversations.tiddlyhost.com/#make%20csv%20list%20of%20conversations

\define next-item() $(conversation-id)$,$(conversation-title)$

\define built-list() $(current-list)$<br>$(next-item)$

<$button>
make a blank tiddler for the list
<$action-setfield $tiddler="CSV List" tags="ChatGPT Manipulation" text="conversation_title,conversation_id" overwrite="yes"/>
</$button>



<!--get the next item-->

<$list filter="[chatgptelement[conversation]first[10]]" counter="num">
<$vars conversation-id={{!!title}} conversation-title={{!!conversation_title}}>

<!--''item <<num>>''<br><<next-item>><br>-->

<$button>
<!--get the current list-->
<$list filter="[title[CSV List]]">
<$vars current-list={{!!text}}>
write item <<num>> to the list

<$action-setfield $tiddler="CSV List" text=<<built-list>>/>
</$vars>
</$list>
</$button>
</$vars>
</$list>


I am not sure what you mean here?

If you look at existing export templates you can see how you iterate multiple tiddlers from inside one tiddler so it looks like the desired output.

See Creating a custom export format

Thanks for the response. I’ll try again using an export template, though the issue is that the export exports the actual text of a tiddler, rather then specific fields/values of the tiddler; if i could get a csv with one line per tiddler I’d be done!

I can’t quite get it to iterate on its one, though.

shouldhave been:

I can’t quite get it to iterate on its own, though.

I meant I can’t get the script to iterate across multiple tiddlers. My script now requires a <$button> around each writing to the csv list tiddler. I haven’t successfully moved the <$button> so that one button would iterate over each of the tiddlers that are the source of the list. My solution here is to create a new tiddler whose text field has one line representing each tiddler that matches the initial <$list> request.

Itterating the tiddlers is encoded in the template and based on the variable published filter.

To to advanced search filter tab. Filter some tiddler then use different exports to see this in action.

Html exports tiddlers with a header and footer content, json at most uses {...}.

Tiddlywiki usualy already contains the code you need to understand it. Learn to follow the code and you could develop your wiki off line on a desert island. :nerd_face: