0

I have a embedded form using Formassembly and based on the URL it will retrieved existing info for SalesCloud. If I hard-code in an email and Lead ID it works trying to figure out the ampscript syntax to retrieve the Lead ID and email so that I can use it in the URL:

<iframe id="content"  src="https://TheFormAssemblyURL?leadEmail={!Lead.Email}&leadID={!Lead.Id}" height="800" width="600"
frameborder="0" ></iframe>

The above would be sent to a subscriber via MC email template once we can query the email and Lead ID FormAssembly will retrieve the rest of the info.

This is what I've tried so far:

<html>
<head>
</head>
<body>
 %%[ var @rs
set @Email = QueryParameter("emailaddress")
Set @rs= RetrieveSalesforceObjects('Lead', 'Id, 'Email', '=', @Email)
Set @row = ROW(@rs,1)
Set @Id = FIELD(@row,"Id")
]%%



<iframe id="content"  src="https://TheFormAssemblyURL?leadEmail={%%=v(@Email)=%%}&leadID={%%=v(@Id)=%%}" height="800" width="600"
frameborder="0" ></iframe>
<script src="//tfaforms.com/js/iframe_resize_helper.js"></script>


  </body>
</html>
0

You're missing a field and a quote in your retrieve AMPScript.

I'm assuming this code is in a landing/microsite page. You can't use an iframe or JavaScript in an email.

<html>
<head>
</head>
<body>
%%[ 
var @rs, @email, @row, @id
set @Email = QueryParameter("emailaddress")
Set @rs = RetrieveSalesforceObjects('Lead', 'Id,Email','Email','=', @Email)

if rowcount(@rs) > 0 then

    Set @row = ROW(@rs,1)
    Set @Id = FIELD(@row,"Id")
    ]%%

    <iframe id="content"  src="https://TheFormAssemblyURL?leadEmail={%%=v(@Email)=%%}&leadID={%%=v(@Id)=%%}" height="800" width="600"
    frameborder="0" ></iframe>
    <script src="//tfaforms.com/js/iframe_resize_helper.js"></script>

%%[
else 
  outputline(concat("<br>lead not found"))
endif
]%%

</body>
</html>

Reference

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.