It seems that the ConsumeItemName property is only marked as VisibleAnywhere but not as EditAnywhere. The EditAnywhere attribute makes the property editable in the Unreal Editor and is required to persist the value when the game or engine is restarted.
To fix this issue, you can add the EditAnywhere attribute to the ConsumeItemName property in the FConsume struct.
If this doesn’t fix the issue, perhaps there is a saving issue causing the data to be removed.
The OnDataTableChanged function is called whenever the underlying data in a UDataTable changes, but it does not provide a mechanism for modifying the data stored in the PayConditions array.
To modify the data stored in the PayConditions array, you would need to write code that updates the values of the FConsume structs in the array directly. This can be done either in the OnDataTableChanged function or in another function that is called when you want to update the data.
For example, you could add a function to the FMarketData struct that updates the ConsumeItemName property of all the FConsume structs in the PayConditions array:
This function would take a FName parameter that specifies the new value to set for the ConsumeItemName property. You would call this function whenever you need to update the ConsumeItemName values in the PayConditions array.