1

I have this scenario right now where I'm coding a cloud page form with SSJS right now (I'm a bit of a noob at this) and the basic functionality is:

-Create data extensions automatically when form submitted (I get this part), and then automatically place data extensions in their respective folders- the folders would be dynamic according to their month:

So the folder structure would look like this
-Subscription Name
-Year
-Month

So it would look something like this: Subscription_1>2021>June

I was originally thinking I could leverage wsproxy to lookup by name, but it seems if I've got duplicate folder names (i.e. June is going to be a folder name in every Subscription Folder for this month) there isn't a way to specifically point at a folder path so that I could get that folder id- does anyone know if it's possible?

The other way I was thinking would be a bit more labour intensive and not as automated, but pre-creating the folders for the year, grabbing those IDs manually and hard-coding it into the SSJS based on the month + year- we've got 10 lines of business though- I'd prefer that I didn't have to do this 120 times.

2

I would not consider that full answer, since the whole answer would require quite a bit of effort. Yet, here is the idea of how you can proceed:

  1. You are already dynamically creating a Data Extension
  2. Create dynamically folder path based on the ParentFolderID
  3. Retrieve CategoryID (=FolderID) via API call done with SSJS, then parse the response body for the needed ID
  4. Use parsed ID to move new Data Extension into it

As a reference you can use those sources:

SSJS Activities: Create Folder path

How to get category (folder) Id of SSJS activities

SSJS Activities : Move Data Extentions in a Folder

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.