Strip Tags for CSV export

Hi, I know we can use a function in data formats to strip tags on the client-side, but how can perform the same action within server actions?

I have a Database query which I export to a CSV file, but I don’t want the tags being included.

The tags are being generated by the Medium-Editor when inserting the data into the MS SQL database. I don’t want to strip the tags before the insert, as the tags are used to format the data correctly on the screen.

Any suggestions.

Thanks,
Ray

Hi Ray, I think the same option is available in server connect:

Thanks for your reply @TomD.

I don’t seem to have any data formats (lighting blot) when picking the column in the Query?

Ray.

Sorry - I was thinking of the options when you insert records, which I see is not what you want. Perhaps you could do it with a custom query or with an extra virtual column. Wappler’s export feature is fairly basic.

It would be useful if formatters were available in this situation.

1 Like

If you know some regex you could use that…

I’m not sure where it may be available via Wappler, but maybe you could build some JavaScript to do it and call it via a flow which then calls your server action.

I did the same when I built a plugin with Bubble, so I may have most of the JS / regex that you need it you want to go that way!

Or maybe mysql stored procedure could do it so you call that first and take the result out to your export.

Good luck!

@Teodor is there a way to strip tags from a server action query using the built-in functionality of Wappler without having to use some custom JS?

Yes, in your case just add a repeat step which repeats your query.
Define your columns as set value steps and format their values as you need. Then in CSV export select to export the repeat step, not the query:

Screenshot_11

1 Like

Wow, this is a great insight into just how powerful Wappler is. It had never occurred to me you could do something like this. I already knew about repeats, and the output flag, and queries, etc. but combining them to completely customise something like a CSV export is awesome.

1 Like

Hi @Teodor,

Thanks for your response and indeed the repeat does allow me to strip the HTML tags. Thanks for this!

Now, maybe I just asking for too much, but when I do the repeat as suggested, I now no longer have headers in the CSV file. I need the Headers for the customer to know what each column relates too.

Ray

Well, are you sure the headers option is enabled in the export step?

Never mind, once I included other columns in the Repeat it populated the Headers.
image

Thanks for your help. It’s away’s best when I can us Wappler the way it was intended to be used to create my sites and apps.

The less custom JS we have to use the better! Great job @Teodor

1 Like