KQL (Keyword not Kusto) Nesting, Document Selecting for an Extranet - sharepoint-online

Longtime member, been a while since posting. Working on building out an Extranet and am running into a stupidly frustrating issue. First time using SharePoint Online as document repository for external (anonymous) users. In doing so, using Azure permissoning, have the documents split up in repositories on SharePoint based on access level. On top of that I am attempting to display them in Highlighted Content Web part, I am not able to sort them out by location AND type. I have a custom column in each repository that defines what type they are, but when I try to add the AND portion to the KQL it doesn't work. Additionally the internet seems to be massively void of actual documentation of KQL.
(
path:https://domain.sharepoint.com/sites/example/Level%201%20Resources/
OR
path:https://domain.sharepoint.com/sites/example/Level%202%20Resources/
OR
path:https://domain.sharepoint.com/sites/example/Level%203%20Resources/
OR
path:https://domain.sharepoint.com/sites/example/Level%204%20Resources/
OR
path:https://domain.sharepoint.com/sites/example/Level%205%20Resources/
OR
path:https://domain.sharepoint.com/sites/example/Level%206%20Resources/
AND
DocType:"Articles"
)
The above will simply pull all documents from those locations and ignore the AND statement. I have tried renaming it to call on the custom column identifier pulled from the source, and that doesn't work either.
The only real documentation I can find on this is: Here
Which doesn't appear to address filtering based on custom column tags.
EDIT: Reformatted to pull all docs from multiple locations using below, but the nesting portion still isn't working
path:(
"https://domain.sharepoint.com/sites/example/Level%201%20Resources/"
OR
"https://domain.sharepoint.com/sites/example/Level%202%20Resources/"
OR
"https://domain.sharepoint.com/sites/example/Level%203%20Resources/"
OR
"https://domain.sharepoint.com/sites/example/Level%204%20Resources/"
OR
"https://domain.sharepoint.com/sites/example/Level%205%20Resources/"
OR
"https://domain.sharepoint.com/sites/example/Level%206%20Resources/"
)

So the additional issue I was running into was the creation of a column to separate out based on the category of file type (not literal file type). Apparently SPO doesn't like it when you create a list and then reference that list to then filter by via KQL. So I found this morning this.
Apparently the best way to do this is create a custom "Choice" column, allow some time for it to flow and update, and then you can reference it via KQL.

Related

Kentico - WHERE condition for custom Page Types page

I have a custom page type for employees, and one of the fields is Location. I want to show/filter only employees in "San Jose" or "San Francisco" and used this WHERE condition below but it didn't work. Apparently, I missed something very basic. Could you help?
Location LIKE '%San%';
I did another test, where instead of page type, I used custom table with the exact field names and was able to filter using the same statement. On a related note, I'm new to Kentico and exploring which is more suitable for creating/maintaining a list of about 100 employees - Page Types or Custom Tables - with the ability to filter by department, location etc. Appreciated your input here as well. Best!
If you're adding the WHERE condition into a standard Kentico repeater or other data source, the syntax looks right except you do not need the semicolon ";".
You'll also want to double check the field name, and if you are limiting your query to certain columns (as is best practice especially for larger data sets) and be sure the field you are filtering on is being selected.
Regarding the management of your employee list, either method you've described will work. In that scenario it typically depends on who will be editing the content, and how frequently. It is more editor-friendly, in my opinion, to add those documents into the content tree. This also gives you quicker control over the order, and keeps it similar to how other content on the site is maintained. I also like to set up folders or other parent page types as categories if needed, so the documents can be dragged and dropped between them and it sets up a visual taxonomy that isn't possible if it's all stored in a table. Storing items in the tree also allows for workflow and versioning, as well as more granular control over permissions/access, if this is important to you.
It's awesome that you are thinking about how to best store your data in advance. There many factors to consider such as overall number of records, number of columns, the fact whether you need to use workflow, versioning, preview etc..
The best source of information regarding this would be this article which summarizes all options you have and gives clear explanations of which to use in which scenario.
And to your original question - What components are you using to display the data? Is the repeater? If so, can you make sure to set the Page types property to match the page type you are displaying? If the page types is not configured, Kentico will not load any custom fields because it doesn't know from which table it should load the data from.
Additionally make sure to either include the "Location" field in the Columns property or leave the columns blank (not recommended because then Kentico loads all columns which is like 200. when you count all from CMS_Document, CMS_Tree etc..)
Below is the framework that I use to debug whenever I wish to add a repeater and is facing some problem.
First get all the columns instead of accessing limited columns. Fetching all columns will make sure that I don't have any problem retrieving data.
If I am missing any particular column information name, then I would double check the column name.
I verify this by firing up SQL server management studio and access data from page type table or custom table.
If access to SQL server is not available(generally in Azure hosted solutions with restrictive access to DB), I would enable SQL debug from the settings and see what query repeater is generating to see if it is correct.

Update CRM data using Excel sheet and custom identifier

I have to import data from a foreign system into a CRM instance. The foreign system has an ID for either a contact or account (which is also present in CRM, the common identifier).
I'm wondering if it would be possible to extract that data simply through SQL Management Studio, paste this in an Excel file, upload that file through Data Management and have CRM recognize a certain column (the common identifier) as the key, and update all the other fields that would present in that Excel file I plan to upload.
For example, in said foreign system I have:
ClientID ValueNotPresentInCrm
344555 Bleh
And currently, in CRM, I have
accountid xmr_clientid xmr_ValueNotPresentInCrm
24436EDB-9CFA-E511-80C0-00155D7B5806 344555
Obviously, I want to update the xmr_ValueNotPresentInCrm column.
Is this even possible ?
There are two distinct flavours of Excel upload in CRM.
Create new records.
Update existing records.
You will need to use option 2, this involves downloading an Excel file (actually XML) which contains the existing records, making changes in Excel, uploading the file again.
Its a little long winded but is the simplest solution. PowerObjects has a nice tutorial here.
I would also take a look at the Configuration Migration tool from the SDK. It allows you to specify a uniqueness condition on import (see step 12), which would be particularly useful to your scenario.
There is also an open source, custom tool called the Dynamics CRM Configuration Data Mover which you also may find useful. It's less relevant to your scenario because it doesn't seem to have an equivalent uniqueness condition feature, but it's still worth noting.

Copy list items from one sharepoint server to another programmatically

Is it possible to copy a sharepoint list from one server to another server?
So I have server A running site 1, I want to copy the list from ServerA-Site1 to ServerB-Site1.
I've seen numerous articles on SO, to copy from one site to another as long as the sites are on the same server.
I've already looked at several articles like: Programmatically copying custom content type and columns from one web to another
copy list items from one list to another in sharepoint
From the looks of things, it does not seem possible but I'd like confirmation or direction to a possible answer (if I wasn't looking in the right areas)
You can try to use Client Object Model
But it can be tricky because of some special field types (for example, metadata field or person or group field).
Yes, it is possible. You can define two client context for each of your site and then get the required lists and update them using some variables. This should do it for you.
See the content migration API:
http://msdn.microsoft.com/en-us/library/ms453426.ASPX
You should be able to export items, transport them to the second server, then import them.

Add a field to a query where the data comes from a subform

I need to filter a a table with parameters that are calculated on a non related table, but to do this in Access web I need to add the [Project_Id] to the task list.
To clarify further, the user answers some questions regarding the details of a project, which in turn will calculate in the background a group of parameters that are needed to sort a task list.
The problem is the task list is generic and not related to a project so before I can use the project related filter parameters I need to assign a project id to the task list or there is no relationship and no way of knowing what project parameters to use.
I tried to do this with a query but being a Web database I am unable to select the data from the form control.
Hopefully someone can help me find a solution, because I have exhausted Google and my own knowledge on the subject. One last thing I am unable to use code thanks to security issues.
In case anyone is interested I found away to assign the project id to the task list using data macros.
The data macro is assigned to a table that is related to the project and when updated edits the tasks list to add the current project id for each record in the table.
I still have some issues to work around, but in general it does what I need.

How do I store this external data in SharePoint?

I am using Visual Studio 2010, SharePoint 2010 with custom document content types and forms. And plan to also use jquery to build the document add/edit/view forms.
I am developing a solution where I want to have a document library where each document uploaded also has a number of external data elements added as metadata.
The tricky part I'm trying to figure out is I want the user to be able to specify and add a multiple number of those same external data elements.
I'm trying to figure out how I represent the data internally in SharePoint. My initial thought is to programmaticly add hidden external fields as the users adds those external selections. But then I also think of simply storing those external elements as non-external text fields but have my own code which performs the external data lookup and validation.
I'm not adverse to significant custom coding, as I'm probably going to need to do a lot anyway since even the user interface is going to be a jquery tabbed form to enable all the external data the user will be able to associate with each SP document.
I've made an attempt to hopefully further explain what I'm trying to do and included that image. Essentially I'm wanting to add 1+ external data relationships to each document, as desired by the user.
It uses just example data. I'll actually have 4-7 different complex relationships much like the example. And the user is permitted to drilldown and select 1, 2 or all 3 of the dropdowns.
Think of it as similar to how here on Experts-Exchange we can add multiple zones to a question.
An example illustration is here: http://flic.kr/p/aFUSJn
Could you simply add a multi-line text column and have the user input the metadata with comma's, then use your code to seperate the data and do what you want with it?
You said you were not adverse to significant custom coding :)
One solution is to use SharePoint content types. The trick is that not all items in a list need to have the same content type.
Therefore, you can do the following:
As the user is selecting the fields he wants to use you generate or select a content type that matchs those fields.
You then add your document to the document list using the content template
You then have all your information strongly typed in SharePoint lists.
We have previously built a system where we generate content types based on xsd files, this worked very well.

Resources