Formula field with IF statement based on picklist field and string output to copy/paste in multi-line field via function

Formula field with IF statement based on picklist field and string output to copy/paste in multi-line field via function

Hello there,

I am working on a formula field based on a 3-item picklist field (i.e. *empty value*, 'Progress payment', 'Letter of credit'). Depending on the picked item, the formula field shall give a specific multi-line string (say 'XXX' in case of 'Progress payment', 'YYY' in case of 'Letter of credit'); in case no value is selected from the picklist field (like by default), the formula field shall give an empty value.

I tried with following formula, but it didn't work:

If(Contains(${Quotes.Payment schedule (type)}, 'Progress payment'),'XXX',
If(Contains(${Quotes.Payment schedule (type)}, 'Letter of credit'),'YYY',''))

Could you please tell me how I should change it for it to work?

The formula field's content shall then be automatically copied and pasted in a multi-line field via the following function:

paymentscheduleterms = input.paymentscheduletermsf;
mp = Map();
mp.put("Payment_schedule_terms",paymentscheduleterms);
update = zoho.crm.updateRecord("Quotes",quoteId,mp);
info mp;
info update;

Thanks!

Regards,

Valeria

    Nederlandse Hulpbronnen