-- CIVI-8, modified code to use query to fetch file id, since the core getEntityValues function alters value by adding <a> tag