how to get the list of folders in a test lab in ALM using REST API? - alm

I am looking for a way to get the list of folders under a test lab and display it in some UI. Is there a way to get the list using REST API? I tried /test-set-folders but I didn't see the folders that I am expecting.

There are two types of folder hierarchy test lab and test plan. Both are different entity types.
In side the test lab, you can have following kind of hierarchy
Folder1
Folder2
Test-set1 <-- this is test set (not a folder)
http://..../test-set-folders whill give you the list of folders, not the test-sets. This is paginated result. So if you have more than specified limit then it will display the first 100 or whatever is the limit. To get the next set of folders, you need to fetch the next page.
http://..../test-set-folders?page-size=100&start-index=101
Using above query it will bring next set of folders and you can further iterate till last page by changing start-index (increment by page-size)
Hope this will help.

Related

Power Automate: Sweep thru Subsites in SharePoint and copy new files

Good Day!
I am struggling with the best way to approach this via Power Automate.
Desired Flow: This will be a scheduled flow that would trigger every 10 minutes. Cycle through a SharePoint List that contains a list of subsites within my enterprise along with the path to a specific folder in a specific library. Using the 'Apply to Each' function, identify any NEW files since the last sweep. Copy those files to a different directory in SharePoint (details of which are also included in that same SharePoint list).
I have got all the pieces to this EXCEPT: How to identify the new files since the last sweep.
Can't use the "when a new file is created" trigger, as this listing has close to 300 subsites on it....which would mean 300 different flows.
Appreciate any guidance!
UPDATE:
Getting an error when using the Get Files. Here is the snippet of the flow:
Snippet of the Flow Where error is occuring
Snippet of the SharePoint List
I would use a Get Files (properties only) action with a Filter Query which uses an Created greater than 10 minutes ago.
Below is an example.
Created ge '#{addMinutes(utcNow(), -10)}'
This is for the second part of your question.

Excel Power query: search one folder deep

I am doing a power query in excel and im just using it to list all files in a specific directory.
I have two problems:
I cannot choose a sharepoint for the query. I may only choose folders on my hard drive. Is it possible to use a network sharepoint?
When I choose the folder i want, the query digs deep in all subfolders and list all files. However, i want it to search max 1 subfolder deep. and not 300. Is it possible?
Thanks for anyone who can help me! much appreciated
PS: If there is a vba code which lists all files one subfolder deep, this would also be a great solution
You can choose a network SharePoint folder by using the SharePoint Folder connector under Get Data. But you have to only use the root folder as your target for the URL. That will bring up a list of all files that exist within the hierarchy under that root folder. From there, use the Transform Data button (not the Combine & Transform Data button). Then you can rely upon the Folder Path column to filter for your desired actual folder.
[The Folder connector works similarly to the SharePoint Folder connector, in that it will bring up a list of all files that exist within the hierarchy under the targeted folder.]
I am not aware of it being possible to go straight to your desired folder using either the SharePoint Folders connector or the Folders connector.
filter the results of your list of there is a PATH column

How to get power apps to handle folders in a list properly

I have a SharePoint Online list that uses folders with unique permissions. Each user can only see their own personal folder and the items inside. I set the default view to show content inside of folders rather than flat. In SharePoint, the user first sees their personal folder at the top level of the list. They click on the folder and add items inside of it in order to keep them private. Seems to be really tricky for a power apps beginner like myself to create that in power apps and I'm looking for some ideas on where to start.
I know I can make the start screen gallery be filtered by only showing things that have a content type of folder. Hopefully, this would respect permissions and show each user only their own folder like in SharePoint Then, when you click on the folder, it would take you to a gallery on another screen. But this screen would have to be filtered to only show items that relate to the folder clicked on. SharePoint does this naturally. So the second gallery would have to somehow be filtered by knowing what was clicked on to get to that screen. I don't want to make a screen or even a gallery for every user case.
Also, I need to make sure that any entries on the second screen are being entered into the person's folder rather than the top root. SharePoint seems to record it as being under that folder, but will power apps do the same?
Can anybody get me started or give me some ideas as to how to approach this? Maybe an article that solves a similar problem? I couldn't find one yet. Thanks.
If users don't have directly access to share point is the best way for build your app, you may put all file in the same folder and filtered by a column with user informatcion, for example: column isFolder with values ["Yes", "No"] yo can filter and show in gallery only folders and column userEmail you can filter folders for a especific app user.
In case users have access to sharepoint you must create a connection for each user folder to collect files inside and show it in second screen and populate gallery with condictional (switch or if), for example: Gallery Property:Items = If(User().Email = FirstGallery.Selected.userEmail, colForThisUserName)

List child items of SharePoint document sub folder

I am trying to use Microsoft Graph to list and download files in SharePoint. I'm using direct http not any library. My problem is that I cannot list child items of subfolders found in SharePoint libraries.
I start the process by using this call to obtain a list of drive Ids:
https://graph.microsoft.com/v1.0/sites/host.sharepoint.com/drives
("host" is actually different for my site)
Let's say a driveId is "ABCDEF". I then use this call to obtain a list of files within the SharePoint drive:
https://graph.microsoft.com/v1.0/sites/host.sharepoint.com/drives/ABCDEF/root/children
This yields for each file a fileId and filename. If my document library has a subfolder created, I can differentiate between files and folders by looking for the item "folder". The id of the subfolder looks similar to those of files. Let's say the folder Id is "XYZ".
Now I want to obtain a list of child items for the sub folder. I use this call:
https://graph.microsoft.com/v1.0/sites/host.sharepoint.com/drive/items/XYZ/children
Unfortunately this results in http error 404 with the message "The resource could not be found". I have tried variations of this url, such as drives/XYZ/root/children but nothing works.
Could someone provide me with the correct url to obtain a list of files from within a SharePoint library
subfolder?
This is because the default drive host.sharepoint.com/drive/ is different from host.sharepoint.com/drives/ABCDEF.
XYZ is under ABCDEF rather than the default drive.
Use https://graph.microsoft.com/v1.0/sites/host.sharepoint.com/drives/ABCDEF/items/XYZ/children should resolve this issue.

Automatically create Subfolders on SharePoint Document Library

I have been trying to accomplish this for weeks now and end up hitting a wall.
I have a document library on SharePoint Online with the following (close enough) structure.
Clients
-> Schools
-->Client Name
--->Communications
--->Documentation
--->Projects
---->Project Name 1
---->Project Name 2
->Retail
-->Client Name
--->Communications
--->Documentation
--->Projects
---->Project Name 1
---->Project Name 2
... and so on.
Inside the "Projects" folder there is a set of folders as well.
Right now we have a Project template folder that we used to just copy/paste and rename when we had our file server, but now on SharePoint, the copy to process is way too many clicks to get it to that location.
What I am trying to accomplish is be able to create a new project folder and automatically create all the folders under it.
Appreciate the guidance on this.
I was able to figure this out.
My challenge was when creating the folder, it always wanted to create it inside the root of the document library and not the subfolder.
So I created 2 Content types for folders, one for clients and one for projects.
Used SharePoint Designer to create the workflow, but the trick here was to extract the URL from the current item, which is the folder being created, and remove the first x amount of characters from it which equals the SharePoint document library location. The remaining part of the string was the exact location where I wanted the subfolders to be created.
After that, I used that variable to create all other subfolders.

Resources