Copying links from SharePoint files with FME? - sharepoint

I am trying to automate one process for regular updates from the field devices to AGOL (each hour), and I made everything except I am struggling to parse the file links to the right feature.
The file names and the feature names are stored in SQLite DB, which is not a problem because I read them and made all necessary joins, but the files are automatically uploaded to folders on SharePoint and I don't have the links for them in the DB (there are few TB of videos, so it is difficult to change the process to keep the files into DB).
There are 3 types of files for each feature: pdf, images and videos, and all are stored in separate folders and subfolders.
the pdf structure on sharepoint looks like this:
project location/pdf (name of the folder)/featureid (name of the subfolder)/name_of_the_pdf_file.pdf
project location/videos (name of the folder)/name_of_the_video_file.mpg
project location/photos (name of the folder)/name_of_the_picture_file.jpg
So I have the file names in the DB table, and I have their relation with the features on AGOL, just I can't find a way how to copy the links from the SharePoint for each feature.
I have some idea with python, but I can't use it, as the company does not want to buy other VM, they already use the FME cloud, so it have to be in FME :/

Related

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

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.

SharePoint changes the Size of MS Office files when first saved, since Metadata is added. Possible to confirm that Content has not changed?

Suppose we are migrating a set of MS Office files from (say) a Shared drive to SharePoint (eg SharePoint Online). Limited to Office 2007 onwards, so file extensions like DOCX, XLSX.
We see that the size of the file changes when it is saved to SharePoint - as certain metadata is added.
(Though file sizes of non MS Office files such as PDF or JPEG do NOT change).
These MS Office files are "containers" in which are placed a number of component parts - this situation can be viewed crudely by changing the Extension of an XLSX file (say) to ZIP, and opening it with WinZip.
For good sound integrity reasons we want to assure ourselves that the "File Content" component part has not changed.
How can we identify the component parts within those containers which represent the Content?
Are such component parts Invariant when when saved to SharePoint as described?
If so, are there any utilities which could analyse a pair of such files and confirm that the content is the same, or if it has been changed? Is there perhaps some checksum we could generate from both files and compare.
If no such utility exists what sort of environment would be best for creating one? - could it be done in VB.NET and/or C# for instance?
Thanks.
This previous post related to same issue, but does not provide the sort of answer we need. C# - Hash contents of MS Office documents without metadata
Interesting topic.
How can we identify the component parts within those containers which represent the Content?
within the docx you will need to assess each of the content files. Please be aware that the files within a docx are compressed using deflate. So you will probably have to inflate them. This is not only the document.xml and the document.xml.rels file but also:
- the header xml files (can be more then 1)
- header .rels files
- footer xml files (againa multiple files)
- footer .rels files)
- the media files (containing images)
You even have to check the core.xml file if SharePoint property demotion alters a field like title.
To summarise, you cannot compare the docx files at the docx level. You will need to unpack them and compare (use e.g. CRC32 or MD5) each of the "content" files.
I am not aware of utilities providing this functionality.
Note: if you just need to upload the files to SharePoint for archiving then placing them into separate zip files might be an alternative. This is of course only an option if you just need to store the content and do not expect the users to make any changes.
Paul

Creating tables within ckeditor from uploaded files

Would it be possible to create and populate tables within ckeditor from uploaded files?
A user would choose a file from their machine in any format such as word, excel etc and it could display a formatted table in the editor....
It is pretty clear that one can create a table in CKEditor. Also, it is possible to add a table automatically. Now, if you want to automatically add a table based upon the content of an uploaded file, then:
create a form where the file can be uploaded
implement the feature with which one can upload the file
make sure you know where your files are, either using a database or a deterministic algorithm
implement a server-side functionality which prepares the content (table) data
use the prepared data as input at client-side

sharepoint workflow to move files of a content type to new folder (after creating it if needed)

I have multiple SP document libraries for different meetings. I want to keep the libraries organized by meeting day. So each meeting would have it's own folder and all the files for that day would go in that folder.
To make it easy I wanted to make it so you can upload a file and then a SP workflow will create a folder for that meeting, if needed, and move the file.
So I created a "meeting file" content type that also gets meeting date and file type (minutes, presentation, misc, etc...)...
What I need to do next is check if a folder for that meeting date exists and create it if it does not. Then move the file over to that folder.
Any ideas how I could do this?
I could also try it without using content types but then the workflow starts automatically for every file added and then I cannot create a new folder with that workflow (because it would start a new instance of that workflow).
I was hoping to keep it reusable so I could just use one workflow for all the document libraries. I thought the workflow could find the path of the list it is being run on, and create the folders and do the other work within that list.
Any ideas are appreciated.
For creating folder via workflows:
Creating folders and sub-folders using SharePoint 2010 Designer Workflow
and for checking folder name:
Create a string workflow variable.
Now create a lookup for your folder and set the variable to the folder's title. Take a look here for some helpful information and usage guidelines when it comes to list folders.
The actions dependent of the existence of the folder have to be placed inside an if-statement
E.g. the if-statement should be like "if [variable] not equals [folder name]" if you want the actions only to be run when the folder does not exist
and here the whole tutorial that I found:
Create folders using a SPD workflow

Resources