JSSP to List | Community
Skip to main content
davidl14970702
Level 4
August 15, 2018
Solved

JSSP to List

  • August 15, 2018
  • 2 replies
  • 3910 views

Im bringing in data by JSSP. I can subscribe and write to the rec table, but I want a single view of all JSSP submissions for for good record keeping. So I'd like to simply add all submissions via JSSP to a list.

I am getting an error with this.

var rcp =

    <recipient

      _operation="insertOrUpdate"

      _key="@email"

      xtkschema="nms:recipient"

      firstName={request.getParameter("firstName")}

      lastName={request.getParameter("lastName")}

      email={request.getParameter("email")}>

      />;    

 

    var list = <rcpGrpRel _key="[rcpGroup/@name] email={request.getParameter("email")} name="LST16133"/>;

    var svc = <service>{request.getParameter("serviceName")}</service>;

    var create = true;

    

    nms.subscription.Subscribe(svc,rcp,create);

     xtk.session.Write(list);

But this is returning this error.

JST-310000 Error while compiling script 'get_we_simpleFormSubmit_jssp' line 18: invalid XML tag syntax (line=' var list = <rcpGrpRel _key="[rcpGroup/@name] email={request.getParameter("email")} name="LST16133"/>;

' token='email")} name="LST16133"/>;

').

JavaScript: error while compiling script 'get_we_simpleFormSubmit_jssp'.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by davidl14970702

Thanks Vipul

I just ended up extending the recipient schema to include a JSSP_flag. Figured that was the simplest/quickest way to do it.

  var rcp =

    <recipient

      _operation="insertOrUpdate"

      _key="@email"

      xtkschema="nms:recipient"

      firstName={request.getParameter("firstName")}

      lastName={request.getParameter("lastName")}

      email={request.getParameter("email")}

      profileID={request.getParameter("profileId")}

      JSSP_flag={"true"}

    />;

2 replies

vraghav
Adobe Employee
Adobe Employee
August 19, 2018

Hi davidl14970702,

The code you are using here is wrong. There are multiple ways to accomplish this requirement.

1. Fill the origin field with some data to denote that the recipient was created using a JSSP page. Then have a workflow run every hour or 15 minute to pull such recipients which have been created since the workflow was last executed and then add them to a list. OR

2. If you wish to have everything executed in real time.

Once you have the ID of Recipient and also the ID of list, use following code.

Assuming ListID is 24447964 and RecipientID is 18995462

//List
var entity = <entityList><key value="24447964"/>

              <where>

                <condition enabledIf="" expr="@id = 24447964"/>

              </where>

            </entityList>

//Recipient

var choice = <choiceList><key value="18995462"/>

              <where>

                <condition enabledIf="" expr="@id = 18995462"/>

              </where>

            </choiceList>

nms.recipient.RegisterGroup(entity,choice,true)

Regards,
Vipul

davidl14970702
davidl14970702AuthorAccepted solution
Level 4
August 22, 2018

Thanks Vipul

I just ended up extending the recipient schema to include a JSSP_flag. Figured that was the simplest/quickest way to do it.

  var rcp =

    <recipient

      _operation="insertOrUpdate"

      _key="@email"

      xtkschema="nms:recipient"

      firstName={request.getParameter("firstName")}

      lastName={request.getParameter("lastName")}

      email={request.getParameter("email")}

      profileID={request.getParameter("profileId")}

      JSSP_flag={"true"}

    />;