Insert Lookup Field Issues

Insert Lookup Field Issues

Hello all:

I am using a stateless form to add new contacts.  I have a lookup field Company1 in my stateless form that I am trying to insert into my Contacts form.  I started by inserting company_list = input.Company1 but when I view the record in the contacts report, it shows the ID field, not the company name.  I revised the code to fetch the company name based on the ID and attempted to insert it as company_list = clist.Company.  This results in an error when attempting to insert the record.  The code snippet is below, thanks for any help!

  1. clist  =  company_list  [ID == input.Company1];
  2.         catname = input.Last_Name + ", " + input.First_Name;
  3.         insert into Contacts
  4.         [
  5.             company_list = clist.Company
  6.             Last_Name = input.Last_Name