Check existing records and inserting or updating the html content.