Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

113
Views
Cant figure out what is going wrong while using formik

consider the following code:

const handleEmployeeNumberChange = async (e, value, name) => {
        if (name === 'Employee Number') {
            const employee = await employeeServices.getByNumber(value);
            formik.setFieldValue('Employee Name', employee['Personal Information']['Employee Name']);
            formik.setFieldValue('Designation', employee.Company.Designation);
            console.log(employee.Company.Designation);
            formik.setFieldValue('Department', employee.Company.Department);
            const element = { target: { name, value } };
            formik.handleChange(element);
        }
    };

Some useful information:
The setFieldValue for the Department is working as expected, but not working for Designation. it is setting "" as the value, I logged the value of employee.Company.Designation and it is what is expected. I will post a small clip below for more clarity:

https://imgur.com/a/6Oduo7Z

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!