Auto populate Text field with a lookup field

Auto populate Text field with a lookup field

I've been looking all over for a solution and can't figure out why this is happening...

I want to populate a text field with the value of a lookup field on the same form. 

I've been using the same fetch script that I've seen everywhere but no luck. 

I've placed it on the lookup field 'Company' - 'On User Input' within the Real_Estate_Brokerage form in hopes of populating the 'Company_Name' text field. 

  1. data  =  Real_Estate_Brokerage  [ID == input.Company];
  2. input.Company_Name = data.Company_Name;

If I just enter

  1. input.Company_Name = "Hello";

It shows the text but not when using the fetch script above...