Hi, Im trying to use the xtk.session.getValue("name") method in my javascript file and also do a xtk.include("xtk:session.js") function with that. But when I look in datakit\xtk\eng\schema the include.xml doesnt exist. And when I look in the session.xml the method getValue() doesnt either.
How can I go on from here?
Best Regards,
Martin
Solved! Go to Solution.
Views
Replies
Total Likes
If you're having trouble using xtk.session.getValue() or xtk.include() in your JavaScript file, there are a few things you can check:
1. Ensure you have included the session.js file in your JavaScript file. You can do this by adding the following line at the top of your JavaScript file:
xtk.include("xtk:session.js");
This line tells the platform to include the session.js file in your script, which contains the xtk.session.getValue() method.
2. In Adobe Campaign Classic, JavaScript files can be run on either the client-side (in the web browser) or the server-side (on the server). The xtk.session.getValue() and xtk.include() methods are only available on the server-side, so ensure that your JavaScript file is executed server-side.
3. Check for errors in your JavaScript file. If your JavaScript file has syntax errors or other issues, it may prevent the xtk.session.getValue() or xtk.include() methods from working correctly. Check the console logs for any error messages that may be helpful.
Hello @marting66652718
To include any file in your JS file, you can use this syntax
loadLibrary('PATH_OF_JS')
Also, The getValue method is not available in the session class.
You can use options to save temporary data as key-value pairs.
set option value
setOption("KEY","VALUE");
Get the value of option
getOption('KEY');
In ACC, Xtk code is used for server-side scripting and to interact with the platform's API.
The xtk.session.getValue() method is a built-in function, which allows you to retrieve a value stored in the current session. The xtk.include() function is used to include other Xtk scripts or functions into your current script.
Regarding your question about the missing files in the datakit\xtk\eng\schema directory, it's important to note that these files are not intended to be edited or modified directly.
Instead, they are generated and updated automatically by the platform based on the configuration of your instance.
If you are unable to find the include.xml file or the getValue() method in session.xml, it's possible that your ACC instance has been customized or modified in some way.
You should be able to use the "xtk.session.getValue()" method and the "xtk.include()" function in your Xtk script without having to worry about the underlying implementation details.
Hello!
Im not able to use the getValue() method in my javascript file. Nor am I able to use the Include();
Best Regards
Martin
Views
Replies
Total Likes
If you're having trouble using xtk.session.getValue() or xtk.include() in your JavaScript file, there are a few things you can check:
1. Ensure you have included the session.js file in your JavaScript file. You can do this by adding the following line at the top of your JavaScript file:
xtk.include("xtk:session.js");
This line tells the platform to include the session.js file in your script, which contains the xtk.session.getValue() method.
2. In Adobe Campaign Classic, JavaScript files can be run on either the client-side (in the web browser) or the server-side (on the server). The xtk.session.getValue() and xtk.include() methods are only available on the server-side, so ensure that your JavaScript file is executed server-side.
3. Check for errors in your JavaScript file. If your JavaScript file has syntax errors or other issues, it may prevent the xtk.session.getValue() or xtk.include() methods from working correctly. Check the console logs for any error messages that may be helpful.
Hi @marting66652718,
Did @akshaaga's suggestions help you resolve your issue or do you still need more help here? Do let us know.
Thanks!
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies