You can take a copy of the processing script of the ui page and use it as a base .. It is a simple gliderecord insertion and nothing complex