Is it allowed to lie if the lying person feels that the other person may feel bad if he comes to know the truth?

One shouldn’t lie, but one can be creative and not say something that upsets this person. So be creative and say it in a way that the person doesn’t know what happened. But it shouldn’t be a direct lie. Sometimes you can say something and indirectly the other person understands it in a way without you directly saying it. This would be ok.