How to remove CSV Data Source shadow assets on update


#1

I’m using a CSV Data source asset to display and filter data which we plan to update Monthly.
Paired with an Asset listing the functionality works perfectly by printing the assets in a table format.

The issue I’m having is that when the CSV file is updated (with less rows of data) the previous shadow assets are only cleared and not removed. In my instance this creates lots of blank table rows and misleading %asset_count% on the front-end.

Do I need a trigger in this instance or is a CSV Data source not the best fit in for this purpose?

I am trying to keep this as simple as possible to enable the content owner a simple method of self managing this list.

Thanks in advance for any help or wisdom.

Matrix Version: 5441


(Bart Banda) #2

That’s strange, sounds like it might either be caching or a bug. Can you confirm you still get that behaviour with /_nocache?

Another implementation method to try might be to use a File Asset, upload the CSV file there, then use a REST asset to request it and then format the data using SSJS, but not sure if that’s feasible for you.


#3

Thanks Bart

PEBKAC :flushed: or Data fail at least. I’ve since learnt that when rows of data are deleted rather than ‘Cleared’ in Excel when saving to CSV - blank comma separated values are created - which is why all shadow assets remained on updating in my instance.

SSJS method sound worthy of exploring, thank you.