Sharepoint Lookup values - c#

I have one sharepoint list which is using Lookup Field, whose source is pointing to other list in the same site (Master data). While using OData query i don't see that column in my result.
If I use OData url with "FieldValuesAsText" I can see data. Also, I have tried using ContentType Expand and filter but i have no luck in finding.
Since, my list is very big and want to retrieve data in minimum number of calls. looking for some kind of approach or URL which will help me achieve the same

Try to expand look up field to get real value like this:
/_api/web/lists(guid'')/items?$select=Title,LookupFieldName1/FieldToBeExpanded1,LookupField2/FieldToBeExpanded2&$expand=LookupFieldName1,LookupFieldName2
In this endpoint, FieldToBeExpand1 should be the same as the column where lookup get from:

Related

In Azure Table Storage, is it possible to query a substring of a property with .NET Core?

In my Azure Table I have a string property called "Labels" that looks something like this (A Json serialization of List):
["value1","value2","value3","value4"]
Is it possible to query the table for all the entries that contain the substring "value3" in the Labels property?
If you are looking for something like wildcard search eg message like '%SysFn%', it is not feasible at this moment, You can find all the supported operations below
https://learn.microsoft.com/en-us/rest/api/storageservices/Querying-Tables-and-Entities?redirectedfrom=MSDN
Yes, you can filter by any attribute. However please keep in mind that only PartitionKey and RowKey are indexed so any query operation which doesn't include at least PartitionKey will result in full table scan. This will become an issue if your table contains lots of entities.
Hope it helps.

Jama REST Api - Injecting a where clause to GET

I'm using the REST API of Jama, detailed here:
https://dev.jamasoftware.com/rest#operation_getItems
Using this allows me to get a JSON object of all the items in a given project.
However what is returned is limited to just 20 results, to get all the results I need to loop through using pagination.
There is a field in the returned data which is itemType. Is there anyway of injecting a 'where' clause into the GET request so that only items of certain type is returned?
All I'm after is the total number of matching items, seems unnecssary to have to grab everything and then loop through to extract the items of a certain type?
Not sure which version of Jama you are using but in 8.25 we have the abstractitems endpoint, which optionally takes an itemType [array] parameter in the query.
See https://dev.jamasoftware.com/rest#operation_getAbstractItems
the GET request looks like this:
https://myjamahost.com/rest/latest/abstractitems?project=23&itemType=60&itemType=67&...&maxResults=50
unfortunately the response size here is also default 20 and max. 50
Hope that helps
S.

facebook graph api get posts by ids

I am trying to pull a small group of feed/post objects from Facebook Graph API from an array of post ids.
string[] postids = {1234,1235,1236}
Could someone kindly show me the query string that request the posts?
I've tried using (but I know it's not correct)
https://graph.facebook.com/me/feed?ids=1234,1235,1236
No luck
I figured it out. I was pulling from the feed end point in one query and the ids were different based on the query.
You need to include the api version number in your Get request. For example, your URL should look like this:
https://graph.facebook.com/v2.8/?ids=1234,1235,1236

DataView.ToTable not returning distinct values

I'm attempting to utilize the DataView.ToValue function, and while it is pulling the correct columns needed, I am still not getting the DISTINCT values. I have a DataValue that contains a gridview of all of the information on the website. When a client goes to download this data in a specific format, they need just the unique values to be processed into the file.
At present, I store all of the columns needed for the report within an array with the purpose of being dynamic. Once that string array has been created, I create my DataTable with
tblData = dvData.ToTable(true, arrColumns);
Despite this, the data is still coming back with all rows. Am I missing something? According to this from Microsoft's documentation I SHOULD be getting back distinct values.
Turns out I forgot that a step on the backend handles cleaning up NULLs into valid datapoints for the xml. So it was properly sorting, just the null fields were actually causing "copies".

Sitecore WFFM check duplicate email

I am developing a form validation action for WFFM, which will not allow people to use same email for submitting multiple entries. So far, the only document I've got is the WFFM v2.3 Ref from Sitecore SDN, which only have few example of how to access submitted data form by form.
I don't know how to select data by using field value. So, my current solution is to retrieve all data from database and check all email fields; which doesn't seem right when putting in scale.
Do you have any code snippet that can help me add GridFilter like email="abc#def.com", if count > 0 definitely the email is duplicated?
Thank you.
Instead of finding the API supporting this very own demand, I found it easier to make a direct connection to the WFFM database and look up for what I want. Thank you for reading this.
The webforms database has 3 tables only. If for example, you want the list of email ids available in the 'Support Form' below:
Here's the query:
SELECT DISTINCT Value FROM [dbo].[Field]
WHERE FieldId = '5F5643B6-0535-49D8-B3C9-CF8E65A415C0'
Field Id corresponds to the field GUID of the form:
Ps. WebForms connections string should be available in App_Config\Include\forms.config.

Categories