if (form.getFieldValue('category_id')) { const SaveCat = form.getFieldValue('category_id'); fetch(`http://localhost/wp/shopengine/wp-json/shopengine-builder/v1/settings/categories?ids=${SaveCat}`) .then(res => res.json()) .then(data => data.result) .then(result => { Object.entries(result).map(([key, value]) => { const myValue = { label: value, value: key, } if (myValue.value == SaveCat) { form.setFieldsValue({ category_id: myValue }); } }) }) }