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

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)

Related

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.

How to edit a list template in SharePoint 2010?

I have made a number of lists using custom list template in SharePoint 2010. I would like to add a column to each of these lists. Microsoft offers the following super helpful instructions
Edit the list template properties
On the Site Actions menu , click Site Settings.
NOTE On a site for which the Site Actions menu is customized, point
to Site Settings, and then click the settings that you want to view.
In the Galleries column, click List templates.
NOTE This option
appears only to users who have the Manage Lists permission. Site
owners have this permission by default.
The List Template Gallery page appears.
In the Edit column, click Edit Document Properties for the list
template that you want to edit.
Edit the information that you want to
change, and then click OK.
What they neglect to mention is that this gives you access to exactly 3 things
the template file ( eg: myTemplate.stp )
the template name
the template description
My question is, how do you ACTUALLY EDIT THE TEMPLATE? ie: change columns
I van crack open the file itself by downloading the .stp renaming it to a .cab extracting the .xml and making changes there. But without some testing I have no idea what will happen if I try re-compressing that file and replacing an existing template with it.
Has anyone done this themselves? Does anyone know of an alternative method to add a column to a list template?
You can create a List using the template, make the edits, then create a new template from the List you just created.
If you need the template to carry the same name, you can deactivate and delete the original, then save the new template with the proper name.
In SP2003 I used to download the STP file, rename it to CAB, edit the inner XML manually, repackage with Makecab and upload the new STP file back to the template gallery.
However I must say that in SP2010 I can't seem to get what I want (a custom URL column calculated from other columns) without SP throwing fits, so I wish you luck.

SharePoint 2007 - Copy files and assign attributes?

I've got this one thing I'm not really sure where to begin with. In our SharePoint 2007 solution, we've got this project room where each employee has their own folders with their resumé etc. And we want this information to be distributed to their MySite.
I've noticed that I can basically copy the files from one are to the other. But the files in MySite are connected to the corresponding user based on properties of some sort. But they are not regular file properties is seems. When I open all of the files in the MySite files collection, I can see categories such as Title and Name. If I copy a file in there, these properties are blank. And if I manually assign a username to the Name property, the file automatically appears in the correct user's MySite.
Probably horribly explained.. But, is it possible to program this somehow? I would like a nightly or weekly schedule that basically copies the content and assigns the username and title to the correct fields. I can pick up both the title and the username based on the folder names. This I can probably solve later. It's just where to begin that's bothering me. Do I use SharePoint designer? Can I user VB code? Do I have to code at all? I've never developed a thing for SharePoint before. And no, I do not want to be redirected to a basic "Getting started with developing for Sharepoint" site.. Just a simple answer really, on where to begin.
Simple answer: Yes you can use VB. Create Timerjobs.
TimerJobs you can set to start on specific weekdays, specific hours etc. and they do exactly whatever you program them to do.

Restore NewForm.aspx file

How do i restore a deleted NewForm.aspx file?
I dont want it back through the recycle bin, since i made a mess of it, i just want to recreate the original file.
Sharepoint 2003 was able to do this.
could you restore it from the recycle bin and then in sharepoint designer try a "restore to site definition" (right mouse click on the file). P.S. Never change the out of the box newform / editform etc. Copy it, then in the list settings in sharepoint designer (right mouse on list) set the newform property to point to the new copied custom form. This way you can alwys go back by just resetting the property in the list settings instead of getting the problems you have now.
Here's an in-depth explanation: WinSmarts article
As Colin mentioned, always make a copy. Of course, you can recover from deleting or corrupting your newform but it's a little bit of a pain. SharePoint's odd behaviour causes lots of people to do this... very often we create a new SharePoint form but the list refuses to use it as a replacement newform or editform so we delete the original.
Off of the top of my head, I believe you can copy the newform.aspx from another list or library and then update the GUIDs in the source view. Once you retrieve the file, however, you will have to complete 2 additional steps in order to get it to work. SharePoint requires a strange synergy between lists and libraries and their supporting pages. People are aware of the first, which is called Supporting Files, by right mouse keying on list you can choose supporting files for display, edit and new. What most people don't know is that these files, well actaully their components, must be "aware" of the fact that they are of type display, edit, or new. If they are not "aware" then any changes you make to "Supporting Files" will not stik.
To create a new page or update an existing one, locate your newly created or broken newform.aspx, if you are creating it from scratch go to Insert >> SharePoint Controlls >> Form Web Part... select the form web part of your choice and add it. Upon insertion view the properties of the form control andselect the radio button "NEW ITEM FORM". After you save the page you can then select the page as a supporting file for the list and the setting will stick.
The best options is as follows:
Simply delete the bad ListFormWebPart form page if it still exists
Make a copy of one of your good ListFormWebPart form page
Rename the copied ListFormWebPart form page to whatever the name of the bad one was
This works for New, Edit and Display and is the best option because it basically restores you back to the factory default OOB ListFormWebPart instead of creating DataFormWebParts, which have their pros and cons.
I have had to deal with corruption issues with Sharepoint so this is somewhat related.
Create a new list and using SPD, Copy the WebPartPages Section:
<WebPartPages:ListFormWebPart runat="server" __MarkupType="xmlmarkup" WebPart="true" __WebPartId="{203BDF1B-4980-4FEF-A4B5-C5A4C4A1BFA7}" >
...
</WebPartPages:ListFormWebPart>
Now in your list with the corrupt or missing form. Create a new form with SPD. Yes we know it's not the same. Bear with me.
In the WebPart Pages you copied from the donor list you need to replace the ID, webpartid, ListName id and, ListID from the new form you just created onto the save we pulled from the donor list.
On the Newform you just created. delete everything between and replace with the modified donor webpart you just modified.
Save and visit your new default form.
For what it is worth, I was able to recover.
Here is what I did. First, I mapped my Share to a Z drive.
Then, in SharePoint Designer, I renamed my list to list-bak.
Then, I created a new list of the original name (in SharePoint Designer).
Then, I updated the ListName GUID in the EditForm for the New List.
Next, in Command Prompt, I moved my dummy list to bak2, and moved by bak list back to the original name.
At this point, I had my EditForm restored, but it still wasn't working (as it was trying to reference the EditForm.aspx from the bak2 list).
Finally, I moved the EditForm.aspx from the bak2 to the original list, and was able to restore.
I hope this helps some other poor sap.
EDIT: to the OPs question, obviously you would do the same steps, but with NewForm instead of EditForm

SharePoint Designer 2007 - link to a Document Library on a site from another site?

I am trying to create a link to an existing Shared Documents folder on another site. Both sites are on the same server.
Here are the steps I take to create a link to an existing Document Library:
I create a document library web page in Share Point 2007.
I open the document library (AllItems.ASPX) in Share Point Designer.
I delete the existing web part for the list.
In the Data Source Library, I click on "connect to another library" and create a connection to the other site.
I select the document library, click show data, select my rows and click Insert Multiple Item View.
I then configure the look for each field (hyperlinks, etc).
I edit the Filter for this view to show only the files that are for this location.
I click on Data View Properties and select "Enable sorting and filtering on columns (basic table layout only).
Basically I am trying to have a central location for all files for a site and sub sites. I want the sub sites to see the documents for their own location, be able to search through the files, etc.
The problems I am having are:
I am unable to open the links in a new window, even when I set the hyperlink to do so. I would prefer the file be opened in its native application (ie. A Word doc open in Word).
I am unable to show the file icon in the same way it shows up in the original document library.
When I go to the header and click ANY field, I can sort the field ascending or descending but I always get a message stating "This column type cannot be filtered".
Is there an easier way to do this? Or can someone tell me what I am doing wrong? I am new to using Share Point. Thanks for the help!
Some help for problem 1 (unable to open the links in a new window)...
I'm not sure if this will work using the Data View Web Part you have configured. However there is a technique for the List View Web Part. If you add a boolean field called OpenInNewWindow to your document library then documents that have this set to Yes will open in a new window. Try this out - it may work.
If you need to open PDF files in a new window, beware that there is an ActiveX control that will get in the way. Read this question for more information.

Resources