Setting message payload based on condition

Please stick to one thread - posting the same question in two places causes confusion.

Link to other thread here