I want to use a modern SPO team site als a template for similar projects with a prefilled task list (very similar projects).
I created a site template with Save-PnPProvisioningTemplate and tried to add the Data rows with Add-PnPDataRowsToProvisioningTemplate and a empty -fields parameter but that does not work. I need exact the same task list as in the template.
Does anybody know if this is a bug?
I already discussed on this particular topic right here: https://learn.microsoft.com/en-us/answers/questions/211447/copy-spo-team-site-with-task-list-contensrow-data.html?childToView=215328#answer-215328 but wanted to check here before I post a bug on github.
Thanks
Chris
According to the documentation of Add-PnPDataRowsToProvisioningTemplate for the parameter fields:
The fields to retrieve. If not specified all fields will be loaded in
the returned list object.
So, if you leave the -fields parameter empty, it will load all fields including default system fields like Created, Created By, Modified... These default fields are generated by SharePoint and could not be added/edit manually. I think that's the reason that would not work.
So you need to specify the fields parameter which can be edited by end users. Like
column duedate, Title, startdate in the command.
Note: you need to use the internal name of the column, for the description column in the task list. The internal name is Body.
You could change field in the template <FieldRef Name="Description" /> to <FieldRef Name="Body" />. Maybe it would work fo you
I am having the same problem as this post: social.msdn.com.
I am aware that they have an answer but I can't seem to understand what they mean.
So I have set up a managed property and then added it to my refinement panel using this code:
<Category Title="Loan Category" Description="Use this filter to restrict results by Loan Category" Type="Microsoft.Office.Server.Search.WebControls.ManagedPropertyFilterGenerator" MetadataThreshold="5" NumberOfFiltersToDisplay="4" MaxNumberOfFilters="20" SortBy="Frequency" SortByForMoreFilters="Name" SortDirection="Descending" SortDirectionForMoreFilters="Ascending" ShowMoreLink="True" MappedProperty="LoanCategory" MoreLinkText="show more" LessLinkText="show fewer" />
However when I do a search it displays all kinds of GUIDs for the categories as well as the categories I am looking for. I am pretty sure this did not happen when I just had this set up in test.
The crawled properties that I have mapped to this managed property are as follows:
Loan Category(Text), ows_Loan_x0020_Category(Text), Loan_x0020_Category(Text)
I originally had "ows_taxId_Loan_x0020_Category(Text)" mapped as well however I removed it after reading this might be the issue. Ran a full crawl and still no luck. I have also reset the search index and run a full crawl.
Any advice would be greatly appreciated.
Here is the link that is being generated by the refinement panel:
<a title="Refine By: #96dbf06d-8bf8-4ec5-971b-36e27fba1f62;Loan Sale:Participation and Servicing Agreement;#4ac5410c-79e9-4a9a-99fb-66592342ed16;#51e388cd-62df-4e50-98b4-01af5f776aea;#04ac5410c-79e9-4a9a-99fb-66592342ed16" class="ms-searchref-filterlink" id="ext-gen151" href="/Search/Pages/results.aspx?k=LoanCategory%3AServicing&r=loancategory%3D%22%2396dbf06d%2D8bf8%2D4ec5%2D971b%2D36e27fba1f62%3BLoan%20Sale%3AParticipation%20and%20Servicing%20Agreement%3B%234ac5410c%2D79e9%2D4a9a%2D99fb%2D66592342ed16%3B%2351e388cd%2D62df%2D4e50%2D98b4%2D01af5f776aea%3B%2304ac5410c%2D79e9%2D4a9a%2D99fb%2D66592342ed16%22">
I determined that the GUIDs were showing in my refinement panel because they were in fact the contents of one of the crawled properties that was mapped to my managed property.
In order to determine which one I created a managed property for each of the crawled properties and added them individually. I then did an search index reset from central administration and re-ran a full crawl.
I found the guid in the database which gave me the heads up. In the database go to your search db and look for the table MSSManagedProperties. Your db name may be different.
Select * from [_SearchDB].[dbo].[MSSManagedProperties]
Get the managed property you want and then do a query on PropertyStore database table MSSDocProps based on the Pid.
Select strVal2 FROM [_SearchDB_PropertyStore].[dbo].[MSSDocProps] where Pid = ?
This gives you an idea of what data you are getting for that managed property.
Is it possible to use a different alert template for a specific list view?
An example... My list sends alerts using the default OOTB "SPAlertTemplate.GenericList" template whenever new items are added to it. However I want to instead use a custom email template whenever items are added that appear in the High Risk Incidents view.
I know how to create custom alert templates and associate them with a specific list -- just not how to associate them with a specific view of a list.
According to the Alert template documentation you can use CAML in the FilterDefinition property to control what items are shown.
I don't believe you can point it at a view directly, but you could use the same conditions in your view in the FilterDefinition.
So if your view was made up of the condition RiskLevel=1 then you could use something like the following:
<FilterDefinition>
<FriendlyName>CustomFilter1</FriendlyName>
<ShortName>CustomFilter1</ShortName>
<Query>
<Eq>
<FieldRef name="RiskLevel"/>
<Value Type='Text'>1</Value>
</Eq>
</Query>
Some of these links may help:
Alert Template Format -
http://msdn.microsoft.com/en-us/library/bb802961(v=office.12).aspx
Intro on CAML Query -
http://sharepointmagazine.net/articles/writing-caml-queries-for-retrieving-list-items-from-a-sharepoint-list
I have a content query web part showing 3 events for todays date on our Intranet homepage. However, when a user deletes an event from a recurring series, SP changes the title of that event to "Deleted: [original title]". My content query web part still shows these and I don't see a way to filter them out.
For my list views I get around it with a field and a formula in that field of the following.
=IF(ISNUMBER(FIND("Deleted:",Title)),"Yes","No").
However, that field isn't available to me within the CQWP filter drop-down.
how does one prevent these deleted occurrences from showing in a CQWP?
UPDATE: This is a publishing page BTW.
While you can perform the filter via XSLT, it may be preferable to do so in the CAML query itself. This article from Microsoft, How to: Customize the Content Query Web Part by using Custom Properties, shows how the CAML Where clause is constructed (and may be modified). Good luck!
Have you tried the DataFormWebPart (DFWP) before? It is basically the most basic of databound webparts, but strangely the most customizable as well.
To try it out, open SharePoint designer and create a dummy aspx page to work on / play around with. Then open the datasources pane and find the list you want to use. then click on that list and select "view data". Drag the appropriate fields onto the aspx page. You now have a (very) basic grid displaying your data.
The cool thing is though, all layout is xsl driven, so completely customizable. You can even make the xsl reusable by switching to source view and cut and paste the xs,l into a separate xsl file. To then use this file instead of the inline xsl, after moving the inline xsl, change the DFWP property xsl (that contained the inline xsl) from
<xsl><!-- .... this is where the moved inline xsl used to be... --></xsl>
to
<xsllink>/server relative url to xsl file</xsllink>
The only remaining problem is that the DFWP's datasource is now bound a single list. To do roll-ups cross site collection (if you have say multiple event lists you want to include), you need to change the DFWP's SPDataSource's select query and datasourcemode. How to do that is explained here.
Now to address your actual question: (after my blatant plug of the underappreciated DFWP :-D) The DFWP's SPDataSource basically uses either an SPQuery or an SPSiteDataQuery (depending on the datasourcemode) to retrieve the data, and you can do way more filtering wise. Either in the CAML query itself or by just filter out the unneeded rows using something like the following:
<xsl:if test="not(contains(#Title, 'Deleted:'))">
<xsl:apply-templates />
</xsl:if>
I have a SharePoint document library that has a folder structure used for organizing the documents (but also for controlling access, via permissions on the folders).
The documents in the library are updated every month, and we store every month's version of the document in the same folder; there's a "month" column used for filtering that will contain values like Jan 09, Feb 09, etc. It looks like this:
Title Month
----- -----
SubFolder 1
SubFolder 2
[] Interesting Facts Jan 09
[] Interesting Facts Feb 09
[] Interesting Facts Mar 09
[] Fascinating Numbers Jan 09
[] Fascinating Numbers Feb 09
...
Now, because users will generally be most interested in the 'current' month, I'd like them to be able to apply a filter, and select (say) Mar 09. However, if they do this using the built-in filtering, it also filters out the folders, and they can no longer navigate the folder hierarchy. This is no good - I want them to be able to move between folders with the filter intact, so that they don't need to keep switching it off and on again.
I figured I might be able to use a custom view (selecting where type=folder or month=[month]), and to an extent that does work. However, I can only get it to work for a fixed month, whereas I need the user to be able to select the month - perhaps via a drop-down control on the page (and I don't want to create 60 views for 5 years' worth of months, nor do I want to have to create a new view every month).
I thought it might be possible to create a view in code (rather than via the UI), but I've not been able to figure out how to get a dynamic value (a user-specific setting) into the CAML query.
Any pointers gratefully appreciated! And by the way, I am aware of the dogma that folders are bad, and that everything should just be a list. However, having considered the alternatives, I still favour using folders - if I can solve this problem.
Thanks in advance.
Could you create a content type that inherits from Folder that contains a Month column? Then, replace the normal folder content type with your new one on this list. Set the month appropriately, and now your filter would contain the folder as well.
You might like to try using a DataViewWebpart filtered by a form webpart to do this.
Managing the display of the folders and then the folders items when it is clicked on will be a problem. That is one of the reasons for not using folders I guess.
I'm currently experiencing the exact same issue, instead of a simple date, I need to filter based on folder names and then then show those folders on the page. Once they click a folder they will then be able to view the content of that folder.
I haven't found a good solution for this just yet, but for yours, you should be able to simply create a custom CAML query using the contentQueryWebpart.
Something like this:
Further Customize CQWP
But you would do it on the date/time of the folder and nothing else.
Your query would be something like:
<![CDATA[
<Where>
<Gt>
<FieldRef Name="Created" Nullable="True" Type="DateTime"/>
<Value Type="DateTime"><Today /></Value>
</Gt>
</Where>
<OrderBy>
<FieldRef Name="Created" Nullable="True" Type="DateTime"Ascending="FALSE"/>
</OrderBy>]]>
I would add also the name of the folder you're looking for to make sure nothing else gets returned.
Hope this helps. And please do postback if you find another solution.
I think I found your solution - The DataWebPart is actually what helped me....
Using this also was a huge eye opener:
ASP.NET Controls Filter Data View
To summarize it, you can simply populate your dropdown with the month year combo, add the shared Doc library on the page via the designer view, use a 'filter' connection to your ASP.NET dropdown and pronto you have a filter on a per month.
You can also have it default to a certain date using XSL, it's all in the code-view now :)
#Gary
The Controls filter of the DATA view (my 2nd answer) actually does keep the folder hierarchy.
You can have it go into sub-folders if needed, but in your case you're only interested in showing one specific folder correct?
What you're doing is useing SP-designer to do it, I couldn't find a way to do it via the regular webparts.
drag and drop your shared document library in the 'design' view for the page
Click the common task arrow ( > ) and customize the columns you want to show
Still in the common task, apply a filter of choice. What you want to do here is apply a filter on your Month column, so that the Month column is equal to the current month/year, correct?
The filter will only give you a choice to type something in, type the current month, say May 09. then switch to 'code' view
Find the shared document library, and more specifically look for something like:
< ;Where> ;.... That is the CAML query I had mentioned before. You can do an HTML decode on the whole thing, so that it's a bit more readable.
But in essence, the filter is a simple CAML query.
You want to modify that query, so that your month/year combo is that of the current month/year.
CAML has one feature called <MONTH/> which returns the month in the following format: mm/yyyy (you may need to change the format on your column or create a new one to make it easy on yourself) - Your CAML query should be something a bit like this:
<Where>
<Eq>
<FieldRef Name='Month'/>
<Value Type='Number'><Month/></Value>
</Eq>
</Where>
or
html encoded:
< ;Where> ;< ;Eq> ;< ;FieldRef Name='Month'/> ;< ;Value Type='Number'> ;< ;Month/> ;< ;/Value> ;< ;/Eq> ;< ;/Where> ;
The key to this, is that you're only creating a filter at the root level, on the data view. Once they click on the folder, they're just thrown into the document library and can view everything within the folder.
Hope this help!
ps: on the html encoded I had to add spaces before the ';' so you could see the code.
I have worked a great deal with filtering and the SPGridView. Maybe you can get something out of looking into this post on my my blog.
As I said, donĀ“t know if it will help you but have a look.