What does the Encode codec function do?

I’m using a RAK7200 tracker, and it has stuff in the payload I want to strip out. It’s supplying temp and barometric fields, but since that tracker doesn’t have those sensors, they are always zero. Cayenne doesn’t allow you to mask off/not display a field, so deleting the widgets doesn’t stick.

I am hoping that the Encode function allows me to change the payload. Is that correct? Does anyone have a sample?

No. you can’t change the payload format this way, you need to change firmware at all.
write custom decode function
better to ask in profile forum, here, for example:

Thanks, I have asked there as well, for the specific case.

So I’m confused what Encode codec functions are used for.

encode function needs to prepare the bytes for downlink from appserver to endnode, in case of endnode support it.