If you create new contacts in SFMC you end up with duplicates when they are synced to Salesforce. To avoid this issue keep all of your marketing leads & contacts in Salesforce and sync them to SFMC from there. This cloud page form is designed for Contacts, but could be easily modified for Leads. This form also assumes you know the user that you want to assign leads to, if you don't or if you need to assign them to a queue, you will need to modify how this form works.
Create the retrieval ampscript you will need to correctly assign the contact to a user:
If your lookup value is a query parameter:
<!-- %%[ var @stepRetrieve SET @sfAgentUserId = RequestParameter('sfUserId') set @AccountId = RequestParameter('AccountId') SET @submitted = RequestParameter('submitted') ]%% -->Lookup the user ID if needed
<!--%%[You can populate the Cloud Page with their Rep's (Record Owner's) information using RetrieveSalesforceObjects Ampscript.
The form code can be download there. This form uses the following SF Ampscript to query/create records:
SET @subscriberRows = RetrieveSalesforceObjects("Contact","Id,FirstName,LastName,Email,AccountId,OwnerId","Email", "=", @email,"OwnerId","=",@sfAgentUserId)To be continued...