Fetch Field value from another form based on Lookup value

Fetch Field value from another form based on Lookup value

Hello,

I have a Form called Opportunity and another one called Contact
There is a bi-directional lookup relationship where an opportunity is related to one contact and a contact to one opportunity.

On the Opportunity Form I would like to Display the Contact Title based on the Contact Name I chose from the Lookup.

I created a Formula field with the following:
  1. rec = Contact_Form[ID == input.Contact_Name];
  2. input.Contact_Title = rec.Title;
But i get "Your expression is not valid, please check the syntax" error.

Thanks in advance for your help.