How do i create a custom document property in excel so that i can auto populate with a SharePoint workflow - sharepoint-2013

I am setting up an automatic document generator on our department's SharePoint site - users will submit the necessary details via a SharePoint list and the workflow will run automatically in the background to generate the three documents namely; specification (word doc), clearance form (word doc) and requisition form(excel). I have managed to auto-populate the first two forms. However, i am not able to do the same for the third file, which is an excel file.
I understand that there is no insert function for document property and tried following this particular advise but i couldn't get it to work. https://superuser.com/questions/99386/excel-cell-value-as-excel-document-metadata-property
Anyone know how?

By default, SharePoint uses Word file template as the default template of Document content type.
If you want to create an excel file by using SharePoint Designer workflow, you can create a custom Document Type (in my testing, it is named "Excel Content Type")and set Document Template to an Excel file:
Then add the custom Document into your library, then use "Create List Item" to create an Excel file using the custom content type:
After the workflow runs, the result is like:

Related

How to get the first file from multiple folders in a document library in SharePoint Designer 2013

I have a document library built in SharePoint. Inside this library there are multiple Document Set folders that contain template documents. I want to create a view where it only shows the most recent document from each of those folders. The reasoning is to have a library maintainer be able to drop a new file inside of it's designated folder and the users will be able to see a view with the list of the most recent documents from each folder without needing to click into the library and check each folder to see if a new file was uploaded.
Creating a view on SharePoint directly on the website does not satisfy this requirement for displaying the documents as outlined above. I have looked into a Content Query Web Part, but this feature also does not have enough settings to make this feature work. I opted to using SharePoint Designer 2013 and created a Custom Web Part and got stuck trying to edit the view. Through SharePoint Designer, I've managed to sort the records by their Modification date which puts the most up to date document at the top of the list. Then I managed to group the records by the folder name or "type of template". Now I am stuck trying to parse through the XSLT generated source code by SharePoint Designer and figuring out a way how to only display the first record of each folder/group. I currently have a REST call approach using jQuery and it seems to work fine, but I am trying to find if there is an XSLT approach that can solve this problem.
Update - Adding XML snippet
Here is a snippet of the XML that resembles the library.
<Library>
<Template>
<FileName>ExpensesReport.xslx</FileName>
<ModifiedDate>2022-12-10</ModifiedDate>
<TemplateType>Excel</TemplateType>
</Template>
<Template>
<FileName>Presentation.ppt</FileName>
<ModifiedDate>2022-12-11</ModifiedDate>
<TemplateType>PowerPoint</TemplateType>
</Template>
</Library>

Generating dynamic list columns fields in SharePoint list form

We have created a custom list form with SharePoint designer and now the requirement is like below:
User will request server creation using this form and now server can be of any type which user can choose from a drop-down such as Production,stage,Test or multiple production servers are required. And for each server type, there will be corresponding 20-25 fields which user need to fill for that server details. so i want to know the best way to achieve this as we cant create 200-250 list columns in this list and scrolling also will be a difficult task while user will submit the request. So what is the best way to achieve this requirement?
You can create a list containing all server types that will be used to create a server type lookup. Then you can create a list with a 'Server Type' column and 'Server Requirements' (multiple lines of text) column. You can store all requirements for a particular server as a JSON object e.g.:
{"RAM":"8GB", "CPU":"4"}
OR you can create a nested JSON object for each server type e.g.
{"ServerType": "Staging", "Requirements": {"RAM":"8GB", "CPU":"4"}}
wherever you want to show/send/populate data, you just need to retrieve this json and parse.
Hope this helps.
first I think the recommended way would be to try OOTB SharePoint solutions and in Your case I think You could try to use ContentTypes and OOTB list forms.
Lets say You create a content type per server type. To each type You add only the 20-25 fields that are corresponding to this server type. Then in list settings in advanced settings You turn on content type management and You add does content types to the list (also hide the default Element content type). After that when the user will want to add a new item to the list he will be albo to chose between the content types (server types in Your case), and after that the form will have only the fields that are added to this content type. Also in edit form the user will be able to pick between content types and will see only the corresponding fields. Please see the attached screens to also understand what I mean on a very simple case:
list
ContentType1 (ColumnA)
ContentType2 (ColumnB, ColumnC)
if this OOTB features are not enough and You already created a custom form using SharePoint Designer
Then You should be able to attach custom javascript file to it and jQuery library. The javascript You may store under _layouts path on server. Every field in the form has its own tr (row) You could to each row attach some custom css class like- class="forServerProd allFields" and then in js You could listen onChange event of Your list and show or hide fields with $(".allFields").css('dispaly','none'); // first hide all
$(".forServerProd ").css('dispaly','table-row'); // then show only relevant

Creating Managed Metadata field in html sharepoint

I am showing sharepoint list in jsgrid in custom html.
One of the column in list is of managed metadata type. I want to show this field in jsgrid along with editing. Possible?
If I understand you want to render a managed metadata field in your own jsgrid.
I believe this tutorial could be a start for you
https://github.com/SharePoint/PnP/tree/master/Components/Core.TaxonomyPicker

Sitecore: Create component and insert into placeholder on page creation

We have developed a Sitecore site for a client who will primarily be using Page Editor. We've built page type layouts and then componentized everything else, including sub-layouts of content. This allows them the most flexibility when building pages.
So, an author goes to a page selects the main content area (Placeholder) of the page and inserts basic building block components that we've created. These include Rich Text box, page promos, etc. they can use these to build pretty rich pages with lengthy content.
All page components have the same Datasource Location, which is a "Page Components" folder that's setup as an item bucket.
This is all working well so far.
Now, I'm trying to make it so when a page is created a specific component is created, inserted into to our "Page Components" bucket and placed in a specific placeholder on the page.
I've been trying to build a Branch Template to accomplish this, but I don't see how to specify that the new component should be stored in our bucket location, instead of directly underneath the Page item. Also, how to make the component show up in the placeholder that I want on the page.
Is this possible? Thanks in advance for you help!
You will want to use a command template for this, since you are desiring to programmatically bypass Sitecore's standard layout configurations and branch template creation.
On your page template standard values, you will want to add the sublayout to the presentation details so you can hook the datasource in programmatically after creation.
The fundamental flow in the command will be as follows:
Create the desired page item
Create the desired component datasource in the bucket location
Search the layout definition of the created page item to find the appropriate sublayout to bind to.
Alter the datasource on the sublayout to bind to the datasource you created.
As #jammykam mentioned, there is a recent blog post now available.

SharePoint Word Template central repository

I have to build something like this:
All our Word templates are saved in a central SharePoint Site (Document Library). For every customer we have a dedicated sharepoint workspace. In the workspace there should be a view, webpart or something like this where the all the files from the central template library should be shown. The template files should not lay NOT in the customer workspace.
When an user clicks on a word template in this view, webpart, the document should be opened in word and when the users edits and saves the document, it should be saved in the customer workspace (without prompting for a path).
I know that Content Types would be a possiblity for this, but this is too complicated for our intention.
Is there a possiblity influence word on opening where the document should be saved? Like an Parameter in the URL?
Au contraire, document types are the only way you will be able to get out of this mess unscathed.
For each "template" you can create a "site content type".
You will be able to set the url for that content type to the "template document" in your main site.
Customer site document libraries will then be able to create a "new" document and it will default to the library where they click the data from.
See
Change a content type for a list or library