Add code to load formula from document hash