Is there a device that can be used to grate coconut and sweet potatoes electrically?
Check this out:

Presto 02910 SaladShooter Electric Slicer/Shredder



I haven't used it personally, but two of the top 3 reviews mention using it for grating both potatoes and coconuts.  There's also a "professional" version that's probably a bit more versatile/reliable.

Considering how silly the idea sounds, it seems to have gotten some pretty rave reviews and is also inexpensive.  So give it a try maybe?