Creating folder path using API call

Does anyone have a strategy to share to obtain a folder path from an API call? 

e.g. for customers > company > project > phase > task

I would like to obtain "customers/company/project/phase"

What's the easiest way to get that entire path?  The folder tree gives you only one child in, and the task only gives you one parent out.

Does anyone have an example of how they compiled it? or did you use a different call?

Thanks!

1
4 comentarios
Spot On Innovative Approach Stellar Advice
Avatar
Stephen

Hi Joe,

It would be great to hear a little bit about what you're looking to achieve by doing this if possible. It can open the door a little around possible workarounds people here can provide.

For now, to get further down the path, you need to use the Get Folder documentation to find the name of the Folder you're looking for, here you'll also indentify the Folder ID. You can then apply that ID to, for example, the Create Folder documentation.

You can use this process of finding the ID and applying it to your calls, move down the Folder path.

Perhaps the above helps if not, it would be great to hear what your end goals are so I can look into it a little more.

Also, I'm sure there are other members here who can advise too 🙂

0
Acciones de comentarios Permalink
Spot On Innovative Approach Stellar Advice
Avatar

Thanks for the reply steven. My goal is to simply display a list of overdue tasks on a dashboard in PowerBI. The problem being that if you have templates where you don't add project names imbedded in each task name, then you have no idea what project that task is associated with unless you look up the folder tree. e.g. I have the following structure:

Projects
> Customer A
   > Procurement
       > Assembly 1
           > Buy Component A *
> Customer B
   > Procurement
      > Assembly 1
          > Buy Component A

Lets assume the asterisked task is overdue and I will be displayed in my dashboard table. Now if I perform a call to get the task (task - folder - status), I can get the folder ID just fine, but I will only get something like "Buy Component A - Assembly 1 - Overdue".  I'd prefer to get "Buy Component A - Customer A/Procurement/Assembly 1 - Overdue".  So my issue is creating the path of "Customer A/Procurement/Assembly 1" that includes all the parent folders.  I can GetFolderTree, but that gives me something like the following:
ID             Child 1         Child 2      Child...
Parent > Customer A, Customer B
Customer B > Procurement (instance 1)
Customer A > Procurement (instance 2)
Procurement (instance 1)> Assembly 1 (instance 1)
Procurement (instance 2)> Assembly 1 (instance 2)

Querying a task only gives you it's parentID, you can't get further up the chain it seems.

So it seems like I'd need to write a script or something to concatenate the whole path together, going backwards from Assembly 1? Like find assembly 1's parent, add it, then find that additions parent, add it, then find that additions parent, add it... etc.

I'm looking for advice on a clean way to build the folder path like this.

1
Acciones de comentarios Permalink
Spot On Innovative Approach Stellar Advice
Avatar
Stephen

Sorry for the delay here Joe. I think it's best this is raised to the Support Team to review some possible solutions. You'll receive an email ticket and someone will in touch soon to help 👍

0
Acciones de comentarios Permalink
Spot On Innovative Approach Stellar Advice
Avatar

Joe,

I am trying to accomplish the same type of reporting in PowerBI.  Were you able to resolve your issue?  It's like we need to be able to create a pivot table from the path "customers/company/project/phase".

0
Acciones de comentarios Permalink

Folllowing List for Post: Creating folder path using API call
[this list is visible for admins and agents only]

Didn’t find what you were looking for? Write new post