Hey Ziggy,
Thanks for the reply!
I just tested some code on a new Brine test site and it seems to work great, so there must be something on my client project website that is stopping it working - time to do some digging!
I'll add the code that worked below in case anyone else has issues finding it too.