I am new to SSJS and have not used it yet.
I have a use case where I need to extract JobID and Data Extention Name from SendLog Data Extension.
I use JobID and DE_Name in SQL query but right now I need to run it individually for each email.
Based on some recommendation, I was told to use SSJS, run a loop to extract ALL DISTINCT JobID and DE_Name and push the values to SQL Query in a variable.
Can anyone help with the SSJS and steps as I am new to SSJS?
UPDATE - Progress made so far:
Step 1 - Created a Data Extension "Test_SendLog_Get_DistinctJobs" that is populated by a SQL query (it will run on regular based to get JobID and DE_Name)
SELECT DISTINCT JobID, DE_Name FROM [SendLog_DE]
*Test_SendLog_Get_DistinctJobs DE includes an additional column LU with default value 1 (Not sure how to use it yet in the logic)
Step 2 - Created the SSJS (made an attempt to create a for loop logic)
ISSUE - Getting an error message
ERROR: A runtime error occurred while the SSJS Activity executed the SSJS script. Please review the SSJS activity to ensure that errors are handled properly.