Band Math Problems

I want to change all NaN pixel values with pixel values form another band. So, i wrote this expression "if original band == NaN then reference band else original band. Is my expression correct?

It depends what kind of data you are using.
The check for NaN only works if the raw data is of type floating point.
But often the raw values are scaled, also valid-pixel expression is often used or some no-data value.
Unfortunately, SNAP shows in all cases in the Pixel Info ‘NaN’ as value.
So, it might be better if you use the inverted valid-pixel expression or the no-data value in your condition.

The NaN values are cloud pixels i have masked, and i want to fill these clouds using another product, do you have any method to do that?

As I said, you can use the valid-pixel expression. In your case the cloud mask, I guess.

if cloud_mask then other_band else orig_band

Without knowing more about your data it is difficult to help you further.

Maybe craeting a mosaic is an option for you?

Ok thank you, you are very helpful