3

How do I clear the payload/set it to null in Mule? I've been using:

<set-payload value="" doc:name="Set Payload"/>

This works fine until I add an element to my flow using the GUI in Mule Studio, then the element changes to the following, which throws errors:

<set-payload  doc:name="Set Payload"/>

Thanks in advance.

danw
  • 1,608
  • 4
  • 29
  • 48

1 Answers1

16

Try setting it explicitly to null:

<set-payload value="#[null]" doc:name="Set Payload"/>
Seba
  • 2,319
  • 15
  • 14
  • This suggestion caused a null pointer exception for me. It is easier to just use a message enricher and return the payload opposed to this option. – granthbr Dec 14 '16 at 22:35
  • null is different than empty. This is not the best approach – Dale Nov 10 '20 at 18:58