to array of dict for database intput