Error while executing query: Element 'email' unknown. | Community
Skip to main content
August 18, 2023
Solved

Error while executing query: Element 'email' unknown.

  • August 18, 2023
  • 1 reply
  • 1534 views

Good afternoon, everyone. I'm currently working on uploading an encrypted email file into Adobe Campaign using the Read List activity. 

 

 

Subsequent to this step, I have a JavaScript activity in which I've implemented the following code:

function decryptValue(encryptedValue) {
var decryptedValue = '';
for (var i = 0; i < encryptedValue.length; i++) {
var encryptedCharCode = encryptedValue.charCodeAt(i);
var decryptedCharCode = encryptedCharCode - 1;
decryptedValue += String.fromCharCode(decryptedCharCode);
}
return decryptedValue;
}

var query = xtk.queryDef.create(
'<queryDef schema="temp:readGroup" operation="select">' +
'<select>' +
'<node expr="email"/>' +
'</select>' +
'</queryDef>'
);
var records = query.ExecuteQuery();

for (var i = 0; i < records.length; i++) {
var decryptedEmail = decryptValue(records[i].email);

instance.vars.email = decryptedEmail;

logInfo("Decrypted Email is: " + instance.vars.email);
}

 

After this code, I will need to update that list with an List Update activity, but I am getting this message error while executing the JavaScript activity:

 

And my workflow loos like this:

I would greatly appreciate any assistance in resolving these issues.

 
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 ParthaSarathy

Hi @renanbarhbosa ,

In node expr, try giving "@email" instead of "email"

 

<node expr="@email"/>

1 reply

ParthaSarathy
Community Advisor
ParthaSarathyCommunity AdvisorAccepted solution
Community Advisor
August 19, 2023

Hi @renanbarhbosa ,

In node expr, try giving "@email" instead of "email"

 

<node expr="@email"/>

~  ParthaSarathy S~  Click here to join ADOBE CAMPAIGN USER GROUP for Quarterly In-person | Hybrid | Virtual Meetups
August 21, 2023

Hello, Sarathy. Thanks for the advice, I was able to proceed with the code structure and I got new errors along the process.

 

This is my code right now:

 

 

 

 

 

 

 

And I'm getting those messages:

 

 

 

I need to know why I can't access the 11 elements within my list.

 

Best regards,

Renan. 

ParthaSarathy
Community Advisor
Community Advisor
August 21, 2023

@renanbarhbosa , copy paste the below script and check display logs.

You can able to see email address in it.

var data = xtk.queryDef.create( <queryDef schema={vars.targetSchema} operation="select" > <select> <node expr= "@email" /> </select> </queryDef> ) var output = data.ExecuteQuery(); for each (var result in output) { vars.emailAddress = result.@email; logInfo("Email: "+vars.emailAddress); }
~  ParthaSarathy S~  Click here to join ADOBE CAMPAIGN USER GROUP for Quarterly In-person | Hybrid | Virtual Meetups