Skip to main content

05a/Query for new employees

This job was provided by an OpenFn.org user via the job library API.

Metadata

  • Name: 05a/Query for new employees
  • Adaptor: @openfn/language-mysql
  • Adaptor Version: latest
  • Created almost 5 years ago
  • Updated over 4 years ago
  • Score: 0 (an indicator of how useful this job may be)

Key Functions

alterState

Expression

sqlString(state => {
return "SELECT person_id, person_name, msisdn, status FROM employee_updates WHERE status='NEW';";
});

alterState(state => {
state.new_employees = state.response.body;
console.log(state.new_employees);
return state;
})

sqlString(state => {
return `UPDATE employee_updates SET status='PROCESSED' WHERE status='NEW'`;
});