Updating an individual field within a structure field

I’m looking to update an individual text field within a structure field without touching any of the remaining fields.

I’m aware that I can update a structure field as a whole by calling the update function on the page, but the issue is that this will overwrite the entire structure field (and not just the text field within it that actually changed).

One could first get all the data currently in the structure field, convert it to YAML and then update the entire structure field, but this isn’t a good solution in this case because of the complexity/scale of said structure field. It houses other structure fields and files fields - so I would have to iterate through all those just to update a single text field in the structure.

Thanks a bunch! : )

You can only ever update the page, not parts of it. So yes, you have to do exactly as described.

I wonder if it is so complex, if the structure field is really the right container for the data?