I created file upload section
header.custom.portsPositionFile:
type: file
destination: 'user/themes/hlg/uploads'
label: Select file with port position list
accept:
- .pdf
Now I want to display it inside my link
my link
this return me empty array. How Can I display link to uploaded file?
A file field will allow for multiple files to be uploaded, therefore it will create two object: the first object is the list of the uploaded files, the nested object within is a group of property/value for the given file.
If you only have a single pdf, you therefore should be able to get the link by using the first filter.
{{ page.header.custom.portsPositionFile|first.name }}
From what I see in my frontmatter it outputs path not url so if you want this to work with the file being saved to any destination and not just #self then I'd try this:
{{ page.media[header.custom.portsPositionFile|first.path] }}
Related
I am new to Flow but have created one that works well but would like it to do more. I have created a Flow that pulls any attachment from emails that land in my subfolder ('Reports') in my Inbox, and creates a file in a folder in Sharepoint. This works fine, the problem is when i try to add in the Update File Properties, which i placed right after the Create File actions so they I can auto update their Region ID and Document ID. Once I added the Update File Properties action, the files get uploaded as usual but nothing gets updated.
My Flow:
On new email with attachment (webhook)
Initialize IsSubjectFilterApplied variable(Type: Boolean, Value: true)
Get Email (Message Id: Message Id, Include Attachments: yes
Condition (IsSubjectFilterApplied is equal to true)
X.Check From email address (Subject contains Report)
XX.Apply to each attachment on the email (Output: Attachments)
XXX.Create file (File Name: Attachments Name, File Content: Attachment Content
YXX. Update file properties(Id: Current item, Title: Attachments Name, Region Id: K&B - Americas, Document Type Id: Tracker
When i add in step 4YXX -- it does not update the region ID and document type. What am i missing?
Two ideas you might not have thought about:
Creating a file in a SharePoint document libary will cause that file to have the default content type "Document". If you use your "Create file" action make sure, you create it with the right content type, that includes your properties (Region id...)
Try storing the properties each in a variable beforehand and read out what´s inside while running the Flow.
We have created a workflow on a List that creates a new document in a specific document library based on a template file. We would like to add automation so that a user could choose the template file that they would like to use when "running" the workflow.
We have searched around and found many tutorials on document creation, but none where you selected the template you wanted to use.
Any help?
You can do that with Content type. You can link a template to a content type. So Create X content type on your list (X = number of your template file) and link template file to content type.
to sum up :
Enable content type on your document Lib
Create a Content type on your list
Upload and Link template file to your content type
When create new document, choose your content type to change the template file
I have document library called 'Documents'. In there I have this folder structure 'Public' > 'Documents' > 'Legal'. To display the content i.e. Files and folders I can use a web-part.
But My problem is I only want to display the content of this 'Legal' folders document only not the whole document library documents.
How am I suppose to solve this matter?
Chiranthaka
I just add a field and stop it is been viewed. I put a value in that field and filter the view according to that value.
I have a list with some lookup fields. On their list templates, I followed below steps:
Rename the original .STP to .CAB
Extract its manifest.xml to a local folder (lets call it {workingfolder})
Search for the ProductVersion element. This should have a value of 3
Change its value to 4
Repackage the manifest.xml into a .CAB. I've done this by using makecab.exe in the C:\Windows\System32 folder
Syntax: makecab.exe {workingfolder}\manifest.xml {workingfolder}{template-name}.cab
Change the generated cabinet's extension from .CAB back to .STP and upload it into the _catalogs/lt
I uploaded List Template using elements.xml. But I can't even access List Template using code (given below).
SPListTemplate listTemplate=null;
foreach (SPListTemplate template in SPContext.Current.Web.ListTemplates)
{
if (template.Name.Equals(templateName))
{
listTemplate = template;
}
}
return listTemplate;
I uploaded the same List Template manually with another name and debugged the code. It returns only the List Template which uploaded manually. I know this is a duplicated question, but no solution is working for me.
Is it possible to access the list items in the (hidden) "Forms" subfolder of a document library using the Lists.GetListItems web service method? I need to set the content type of uploaded document templates using Lists.UpdateListItems, otherwise, document created from these templates will have the 'Document' content type and not the content type the template had been assigned to.
Lists.UpdateListItems works in subfolders of the "Forms"' folder, but I need the ows_UniqueId of the list item that represents the uploaded file, and I can only get it using List.GetListItems.
Is there maybe another method of uploading files to SharePoint document libraries, in which you can set the content type?
List.GetListItems expects you to pass it a view, if you don't it uses the defaults view. So what you need to do is create a seperate view which lists all items, and make this view list flat (not listing by subfolder).
Then query against this view.
Does this suck? Yes. Does SharePoint suck? I'll let you answer that question. I didn't write sharepoint, just telling you the way it is.
I don't understand the relationship between the content type of an uploaded document in a document library and the elements in the Forms subfolder.
What I'd try:
- Use Copy Web Service, method CopyIntoItems to upload the file, setting some properties, including the content type.
- Use Lists.GetListItems, with a CAM query specifying the file name and asking for ows_UniqueID property