Hi All,

I would like to request assistance on how I can redirect to a page using the CloudPagesURL value on a Lookup script?

I'm not sure if my code here is correct?

    Set @EMAIL= RequestParameter ('EMAIL')
    Set @AGENT_NAME= RequestParameter ('AGENT_NAME')
    IF @Status == "Yes" THEN

Result is this:

enter image description here

My expected result should redirect to this page and also populating the fields:

enter image description here

Thanks in advance

1 Answer 1


you are inside an AMPScript definition block (opened by %%[ and closed by ]%%) so you do not need to (in fact, shouldn't) add the inline ampscript markings (%%= and =%%) for functions inside it.

This should be more like it (when used on a cloudpage):

IF @Status == "Yes" THEN

CloudpagesURL() is a function which evaluates to a string automatically, so I also removed the '' marking around it.

Note that in Emails, you have to use redirectTo(), not redirect() and here you have to place it inline or you will not be tracking the link.

Which would look like this:

%%[ IF @Status == "Yes" THEN

See also: AMPScript Link Tracking - Does RedirectTo has to be Inline? Understanding

  • thanks for the answer. The form successfully redirected to Cloud Page 400. One thing I noticed is that the EMAIL and AGENT_NAME values where empty. I'm not sure if I need to Concat the values so that they are included on the transfer.
    – Harvey
    Jan 10, 2022 at 8:40
  • check this article, section "example from email": ampscript.com/cloudpagesurl-function - you have to add them into the CloudpagesURL function as can be seen there. Jan 10, 2022 at 8:50
  • like this? Redirect(CloudPagesURL(400,'EMAIL',@EMAIL,'AGENT_NAME',@AGENT_NAME))
    – Harvey
    Jan 10, 2022 at 8:54
  • looks correct, yes. Jan 10, 2022 at 8:54
  • 1
    it worked thanks :)
    – Harvey
    Jan 10, 2022 at 9:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .