Custom Functions that updates Field "Leadsource" based on Campagin-Membership

Custom Functions that updates Field "Leadsource" based on Campagin-Membership

Hello,

I need help building a function which updates the field Lead Source based on campaign Membership. Basically a functions that goes:

"If a lead is in Campagin "Marketing Automation", update field leadsource to "Marketing Automation".

it does not seem to be that hard, but as a non-techperson I just cant get it to work properly :/.


Thanks in Advance for Help

Leon