Not updating the field in child doctype

I have a parent-child structure in my system, where the child includes a field with predefined selectable options. Based on a file uploaded by the user, I extract certain values and attempt to update this field programmatically using data from an external service. However, the update doesn’t behave as expected — the field always displays the first option from the list, regardless of the value I’m trying to set. How to solve this problem ?