My app is a Power App canvas. I develop a combo box in a gallery. The Combo box data source is an API endpoint. I implement an Update formula in combo box OnChange. The Update formula should update the item data of the collection with the selected data id. When run the application, the first row is updated successfully. However, when second row added and combo box updated, the collection item of second row updated with the value of the first row. And the third and so on rows have the same issue.
The update formula is implemented as below, the issue is serviceTreeId is always set with first row combo box selected id. The expected behavior should be serviceTreeId is set with value of the combo box that user updated.

BTW, when I move the Update formula to OnSelect, the data update correctly. However, it has other issue, so it is not a perfect workaround.