I've tried all of the various tricks suggested, even the swinging around in circles, and for most liquids and creams, and sauces/mayonnaise etc the contents are eventually retrievable, but with the detergent gels I've tried nothing works! Even my husband was defeated and had to prise off the end of the container to poke out the remaining gel. And I'm not talking about the last little dollop but this problem occurs when there are several wash loads left, allegedly. I think the problem maybe could be avoided if I ALWAYS shook the container vigorously before use, right from the beginning. It's as if the runny stuff gets separated out whilst the product is standing between washes and then gradually, what is left transforms into the really viscous stuff.
I used to use tablets but found they often left a residue. And I tend to make even more mess with powders than liquids, so I shall persevere with the gels and shake the next new container every time from the first use.