Filter for custom added site columns using rest
Hi everybody,
I'm trying to filter a REST Response by a custom added site column.
when i'm using the endpoint lists() with /Items the filter works great:
site/_api/Web/Lists(guid'805e17b0-2728-4b30-a889-a7e8f025696b')/items?$filter=astringcolumn%20eq%20%27dfg%20-----------------------------%27
but when I'm trying to filter using
site/_api/Web/GetFolderByServerRelativeUrl('/sites/DennisDevSite/alib')/Files?$filter=astringcolumn%20eq%20%27dfg%20-----------------------------%27
I get a response that states Field or property "astringcolumn" does not exist.
event if I add &$select=astringcolumn&$expand=astringcolumn to the url the same error is returned
Why does the first work and the second does not?
Thx in advance
Dennis
P.S.: sorry: I also posted this question in the sharepoint 2013 apps forums. but I think it's better to post it here
Hi Dennis,
Steve as mentioned the reason this happens. You may try any of the following workarounds:
Get the files using Files Rest endpoint and then perform the filteration in the success handler based on the custom column. The Rest query needs to include ListItemAllFields. Example: site/_api/Web/GetFolderByServerRelativeUrl('/sites/DennisDevSite/alib')Files?$expand=ListItemAllFields
Note that you cannot use filter in the Url.
The other option is to use CAML Query Payload, but that can only be used with getitems REST endpoint. However, this will return the ListItem corresponding to the file. It wont be a file object. Example:
function getListItems(viewXml)
var url = "http://aissp2013/_api/web/lists/getbytitle('Management Documents')/getitems";
var queryPayload = {
'query' : {
'__metadata': { 'type': 'SP.CamlQuery' },
'ViewXml' : viewXml,
'FolderServerRelativeUrl': '/ManagementDocuments/F1'
return $.ajax({
url: url,
method: "POST",
data: JSON.stringify(queryPayload),
headers: {
"X-RequestDigest": $("#__REQUESTDIGEST").val(),
"Accept": "application/json; odata=verbose",
"content-type": "application/json; odata=verbose"
var query = "<View><Query><Where><Eq><FieldRef Name='Location' /><Value Type='Text'>Srinagar</Value></Eq></Where></Query></View>";
getListItems(query)
.done(function(data)
console.log(data);
.fail(
function(error){
console.log('Error');
Still, the other option is to use old fashioned ListData.svc. It will allow filter in the url and will also return some file properties like Name, approval status, version etc along with all custom properties. Example:
http://aissp2013/_vti_bin/ListData.svc/ManagementDocuments/?$filter=Path eq '/ManagementDocuments/F1' and Location eq 'Srinagar'
Please remember to up-vote or mark the reply as answer if you find it helpful.
Similar Messages
-
How to add get the field name for a newly added site column.
I have the following:-
Enterprise wiki site collection inside SharePoint server 2013.
I added a new site column of type managed metadata.
I opened the enterprisewiki.aspx page layout using the SP designer, to add the newly added site column to it.
But I have noted that to add any site column I need to know the field name , for example the default wiki category column is referenced inside the page layout as follow:-
<Taxonomy:TaxonomyFieldControl FieldName="Wiki_x0020_Page_x0020_Categories" EmptyValueDescriptionForTargetTemplate="<%$Resources:cms,enterwiki_nocategories_assigned%>" DisableInputFieldLabel="true" runat="server"/>
<b>
So my question is how I can know the field name for my newly added site column?
Thanks in advance for any help.
RegardsHi,
The “FieldName” should be the internal name of the column, you will find it at the address bar at the “Site Columns”->”Edit Column” page:
Best regards,
Patrick
Patrick Liang
TechNet Community Support -
What to do if my master page is too small for custom master page column, I need to change the papersize from A4 to US letter size *
My 2nd gen works fine with WPA2 and AES encryption.
You may need to go back and start over. Reset the router back to factory defaults, log on as the admin, set up security, DHCP, and make sure the IP address pool has enough IP addresses to lease to ALL of the computers/devices that will connect to that the router. -
I'm looking for customer references who are using Oracle IFS or OCM
Dear All,
I'm looking for customer references who are using Oracle IFS or OCM or Oracle Files for their document management systems. So, if anyone can support me i appreciate.We have implemented a document management system using Oracle 9iFS 9.0.2
I would be happy to let you know of our experiences to date.
Niels Montanana
Technology Director
Practical Law Company
London, England -
How to Filter Report by selecting displayable columns using checkboxes
Hello, I have a page where the first region 'filter' is to check which columns you want to have displayed in a report. the second region 'report' is the report itself where i want to display only the columns checked from regions 1 'filter'.
We can make the assumption that there are two checkboxes for simplicity: Part and Part Description. I have created a single item on region 1: filter that is of a checkbox item. the lov is select 'Part' d, 1 from dual union all select 'Part Description' d, 2 from dual
i have also created a page process to run that creates and adds members to a collection.
My report then queries the collection table for the columns but nothing is being displayed.
This is the collection process: (conditional on a submit button)
begin
apex_collection.create_or_truncate_collection
(p_collection_name => 'CHECKBOXES');
for i in 1..apex_application.g_f01.count
loop
apex_collection.add_member(
p_collection_name => 'CHECKBOXES',
p_c001 => apex_application.g_f01(i),
p_c002 => apex_application.g_f02(i));
end loop;
END;
The report is the following:
SELECT c001, c002, seq_id FROM apex_collections
WHERE collection_name = 'CHECKBOXES' ORDER BY seq_id
I have a submit button that then redirects to the same page.
when the submit is submitted, the report comes back with 'no data found'. Any help is greatly appreciated.I should also add...I am using the sql in the report just to display the collection to make sure it is working properly. Once validated, then my sql report will be rewritten to dynamically build the report off of other tables, but it uses the collection to determine which columns to display.
Thanks Jim -
Unable to upload Files to child site collection using REST
Dear All,
I referred this article http://www.shillier.com/archive/2013/03/26/uploading-files-in-sharepoint-2013-using-csom-and-rest.aspx for uploading documents to SP Document Library and it works fine for any document library under the root site collection(
for example "http://<server name>/Shared Documents" but when i upload the same document to one of the sub site collection created using Managed Path( the site collection path is "http://<server name>/files/Case" and the library
name is "records") it fails and i get below error:
The security validation for this page is invalid. Click Back in your
Web browser, refresh the page, and try your operation again, Error Code -2130575251 Microsoft.SharePoint.SPException"
Any help suggestion to resolve this? I've almost tried everything to resolve this issue but no luck.. appreciate any help
for this..
Regards,
VishalHi,
According to your post, my understanding is that you had an issue uploading files to subsite using REST.
I had made a simple code demo below, it will upload a file to Document Library after you make your selection with the File control.
<script src="http://code.jquery.com/jquery-1.10.2.min.js" type="text/javascript"></script>
<script type="text/javascript">
function uploadFile(){
//alert(2);
if (document.getElementById("file").files.length === 0) {
alert('No file was selected');
return;
var parts = document.getElementById("file").value.split("\\");
var filename = parts[parts.length - 1];
var file = document.getElementById("file").files[0];
uploadFileSync("http://YourSite", "Documents", filename, file);
//Upload file synchronously
function uploadFileSync(spWebUrl , library, filename, file)
//alert(3);
var reader = new FileReader();
reader.onloadend = function(evt)
if (evt.target.readyState == FileReader.DONE)
var buffer = evt.target.result;
var completeUrl = spWebUrl
+ "/_api/web/lists/getByTitle('"+ library +"')"
+ "/RootFolder/Files/add(url='"+ filename +"',overwrite='true')?"
+ "@TargetLibrary='"+library+"'&@TargetFileName='"+ filename +"'";
$.ajax({
url: completeUrl,
type: "POST",
data: buffer,
async: false,
processData: false,
headers: {
"accept": "application/json;odata=verbose",
"X-RequestDigest": $("#__REQUESTDIGEST").val(),
"content-length": buffer.byteLength
complete: function (data) {
//uploaded pic url
console.log(data.responseJSON.d.ServerRelativeUrl);
error: function (err) {
alert('failed');
reader.readAsArrayBuffer(file);
</script>
<input type="file" id='file' onchange="uploadFile()"/>
Thanks,
Jason
Forum Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
[email protected].
Jason Guo
TechNet Community Support -
SMOEAC-Filter for Customer Changes not to replicate from CRM to R/3
Hi,
We have 4 subscriptions in SMOEAC for CRM to R/3 replication. They are
1.ALL BUSINESS PARTNERS
2.ALL BUSINESS PARTNERS RELATIONSHIPS
3.ALL BUSINESS PARTNERS HIERARCHIES
4.SALES DOCUMENT ECC.
In the business partners, Now we need to put filter to avoid flow of Customer Master data changes (to R/3) done in CRM.
Iam seeing information in forums that we can able to do that by changing the publication type from Simple Bulk(MSG) to Simple Intelligent(MSG).But Iam not able to change it for ALL BUSINESS PARTNERS in transaction SMOEAC.
pl advice on the possibility.
Regards
A.Sureshbabu.Hello,
Assuming X is the replication object.
1. Remove all the sites assigned current bulk X object. Check the REALIGN and SUBCHECK queues in Tx: SMOHQUEUE and make sure that all jobs triggered due to this removal are complete.
2. Delete the subscription for bulk X.
3. Delete the publication for bulk X.
4. Delete the existing bulk X object.
5. Create a Replication Object (Intelligent) for BDoc type X with Criterial Field selected.
6. Create a Publication for the Replication Object above.
7. Create a Subscription for the Publication and set the Criteria Value.
Please note the subscriptions corresponding to the replication object must be deleted from ALL clients of the server.
Hope that helps.
Thanks,
Rohit -
Hi,
I have custom IDoc , that i am sending to 4 different destinations (systems). My requirement is i need to send for 4 th destinations only header segment.
How do i filter this on the basis of partner profile number
Please don't suggest to change the code. I am looking for this can done without change function module or triggering program.
a®Hi,
You can use segment filtering (transaction BD56).
Here you can suppress a whole segment irrespective of data inside it .
You have to give Message Type/Sender Partner/Receiver Partner.
Regards,
Ferry Lianto -
Custtom settings for my SP site without using a list or having access to the farm/server?
My company has a SP farm that is managed by a support team. I have an SP site in it that I have full access to. I don't have access to the farm.
I wanted to add a custom site settings page and not sure how. I know I can use an SP list but I was looking for something more user friendly.
Everything I have read online says I need to have deploy custom code on the server which I cannot do.
Do I have any other options then a list?Depends... Can you tell us what the custom page will do?
If you would like to add a new link to the Site Settings page you can add a Feature (using just XML) to define that link. That link would point to a page in a library like Pages or Site Pages. (examples:
http://blog-sharepoint.blogspot.com/2011/10/add-custom-links-to-sharepoint-2010-ui.html ,
http://www.sharepointdiary.com/2013/07/add-link-to-site-settings-page-in-sharepoint-2010.html
If you would like to add a new page to the _Layouts path, then you will need access to the server.
Mike Smith TechTrainingNotes.blogspot.com
Books:
SharePoint 2007 2010 Customization for the Site Owner,
SharePoint 2010 Security for the Site Owner -
It happened all of a sudden, any site that requires a new window to open to sign up for something or to choose something it just won't do it. I can't forward any emails because in order to choose the people I'm sending the email to, a new small window with my address book pops up and Mozilla won't let it happen. How can I change this back to the way it was?
Mike,
Are any of your other applications going wonky, or is it just Logic?
I'm afraid I've never heard of this particular problem before, but if it were happening to me the first thing I would do is delete my "com.apple.logic.express.plist" file in Library>Preferences, then repair permissions in Disc Utility, and finally restart my computer. Then I would launch Logic and see if the problem has been corrected. It's amazing how much these two steps can accomplish.
If that doesn't resolve the issue I would launch Logic and go to Preferences>Audio Units Manager to see if all my plug-ins are properly validated. -
For custom tables should we use UTC for date/time fields
A general question.
Can anyone confirm that SAP does seem to be moving towards storing date/time in UTC format?
We're building custom tables and we're making it a standard to store date/time fields in UTC format.
Regards,
LavaughnHello Lavaughn,
I can not speak for SAP, but from my personal experience TimeStamps are the state of the art to store time date info in db tables. Even with date/Time fields a conversion to the local timezone is necessary. Of course you can reuse your db definition on dynpros. But since UI and business logic will be divided anyway this is also not really a valid point.
Best Regards
Klaus -
How to Create a Custom Project Site Template Using Visual Studio
I know how to make changes and save a site as a template but I need to be able to create a new project site template during deployment to different environments. Trying to have this not be a manual process.
Hello,
This article might help:
http://blogs.msdn.com/b/sambetts/archive/2013/10/17/creating-a-clean-visual-studio-solution-from-a-sharepoint-2013-site-template.aspx
Start with a default Project Site (create a new site from the Project site template) and save out the WSP then import into VS.
Paul
Paul Mather | Twitter |
http://pwmather.wordpress.com | CPS -
Help needed for Custom Trusted Reconciliatin API uses
Hi Experts,
I have created Resource Object, One Process Definition and One Reconciliation Rule.
I have mapped FirstName,lastname,username,UserType(End-User),Type(EMP to Role),organization,email .
After that after calling createReconciliationEvent() API, I am getting the following error:
+<Dec 22, 2011 7:49:54 AM CET> <Error> <oracle.iam.reconciliation.impl> <IAM-5010000> <Generic Information: {0}+
oracle.iam.reconciliation.exception.ReconciliationException: Exception occurred while inserting data into table RA_TESTRECONFLATFILE74 due to RA_TESTRECONFLATFILE74
at oracle.iam.reconciliation.impl.ReconOperationsServiceImpl.reconEvent(ReconOperationsServiceImpl.java:285)
at oracle.iam.reconciliation.impl.ReconOperationsServiceImpl.createReconciliationEvent(ReconOperationsServiceImpl.java:189)
at oracle.iam.reconciliation.impl.ReconOperationsServiceImpl.createReconciliationEvent(ReconOperationsServiceImpl.java:212)
at oracle.iam.reconciliation.impl.ReconOperationsServiceImpl.createReconciliationEvent(ReconOperationsServiceImpl.java:201)
at oracle.iam.reconciliation.impl.ReconOperationsServiceImpl.createReconciliationEvent(ReconOperationsServiceImpl.java:197)
at oracle.iam.reconciliation.api.ReconOperationsServiceEJB.createReconciliationEventx(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
Please help.
Regards,
Jhttp://docs.oracle.com/cd/E17904_01/doc.1111/e14308/recon_service.htm#BABGIIIA
-Bikash -
What is a 'tab'? I want to make an App Tab for a web site I use.
What is a 'tab'?
See:
* https://support.mozilla.com/kb/what-are-app-tabs
* https://support.mozilla.com/kb/what-are-tab-groups
*https://support.mozilla.com/kb/Tabbed+browsing -
Use CSOM to create a Site column of type "enterprise keyword"
I have successfully created site columns using CSOM.
When I look at the available types of site columns I can see
http://office.microsoft.com/en-us/sharepoint-server-help/site-column-types-and-options-HA010302196.aspx
But there is nothing similar to what you can do when you go into list settings and say "Add an enterprise keywords column and enable keyword synchronization"
What is the data type for the enterprise keywords column? why should it be directly added into the list via the UI... but not via a site column?
val it: unit=()Hi,
The following code(Client Object Model) for your reference:
static void Main(string[] args)
string siteURL = "http://siteurl";
ClientContext context = new ClientContext(siteURL);
//specific user
NetworkCredential credentials = new NetworkCredential("username", "password", "domain");
context.Credentials = credentials;
FieldCollection fields = context.Web.Fields;
Field field = fields.GetByTitle("Enterprise Keywords");
context.Load(field);
context.ExecuteQuery();
//field schema xml
string fieldSchema=field.SchemaXml;
//update the schema of Enterprise Keywords field
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.LoadXml(fieldSchema);
XmlNode node=xmlDoc.SelectSingleNode("Field");
XmlElement Xe = (XmlElement)node;
Guid fieldID = Guid.NewGuid();
Xe.SetAttribute("DisplayName", "Enterprise Keywords1");
Xe.SetAttribute("StaticName", "TaxKeyword1");
Xe.SetAttribute("Name", "TaxKeyword1");
Xe.SetAttribute("ID", "{" + fieldID + "}");
fieldSchema = xmlDoc.InnerXml;
//add this field to the field collection
fields.AddFieldAsXml(fieldSchema, false, AddFieldOptions.DefaultValue);
context.ExecuteQuery();
Thanks,
Dennis Guo
TechNet Community Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
[email protected]
Dennis Guo
TechNet Community Support
Maybe you are looking for
-
Issues with UpdateAction and later using jbo:RowsetIterate
Hello - I am putting together a BC4J/Struts web app and am having some issues with using the oracle.jbo.html.struts11.actions.UpdateAction class. I am trying to figure out the correct way to reset a row after validation exceptions so that <jbo:Rowset
-
Can anyone explain what I need to do. I am buying a new computer, need to de-authorise my old computer and then put the library on a new windows computer. I have my library backed up to the cloud for which I pay extra. I am not at all technical so
-
I have written a program that executes an .exe file using the Runtime.exec() command and all works fine standalone with the .exe file located in the root of my classpath. My problem comes when I want to deploy it using WebStart, I dont know where to
-
I am unable to get my PXI-5620 to do anything besides appear in NI MAX and pass a self test. I have tried running several NI-SCOPE example VIs, and the NI-SCOPE Signal Express VI on the target "TransOsc" but both fail to find the 5620 module (It does
-
Do i have to authorize my iphone like i would my computer to my account?
i cant make in game purchases, it says "no success, MIght not be set to purchases" anybody no y? plz thanks for the intrest