Get record ID and current module

Recently someone contributed a brand new “collection field” and a “collection file field”

Maybe this will provide you with an easier solution?