Retrieving a sharepoint list in Infopath only shows first 100 records - sharepoint

I am retrieving a list of values from a sharepoint list, which works well but my problem is that it only retrieves the first 100 records. there are currently 500 records that should be available.
Scenario: I have two comboboxes on an infopath form:
A List of Locations
A list of areas within the locations
the list of locations will filter the list of areas but as infopath seems to only retrieve the first 100 records so most of the locations do not show any areas as there is nothing to filter.

By design, the query will only return the first page of results from the default view for the list. Change the item limit for the default view in SharePoint, and you'll change the returned values for InfoPath.
EDIT (links from my comments, here for greater readability):
Here are sources describing this fix in MSDN forum (scroll to the bottom), a blog comment that describes the SharePoint setting step-by-step, one with a screen cap of the somewhat counter-intuitive interface, and another describing performance implications on the server side.
Hope this helps.

Just documenting what I have discovered trying to resolve the problem. I have not been able to change the default view as yet as I dont have the permission to. That should change though.
One possible workaround I have found is that you can export the list to Excel which contains all the data that I was looking for. the file that sharepoint produces is an Excel Query file like "export.iqy". You can save and open the file in notepad. which will look something like the following
WEB
1
http://SharepointSite/_vti_bin/owssvr.dll?XMLDATA=1&List={14C4ED2B-3050-4C47-B5F3-6333C3B0FB28}&View={8E6124E0-23F2-4BA2-86E7-96E7F36BAEC8}&RowLimit=0&RootFolder=%2fLists%2fSharepoint%20Sites
Selection={14C4ED2B-3050-4C47-B5F3-6333C3B0FB28}-{8E6124E0-23F2-4BA2-86E7-96E7F36BAEC8}
EditWebPage=
Formatting=None
PreFormattedTextToColumns=True
ConsecutiveDelimitersAsOne=True
SingleBlockTextImport=False
DisableDateRecognition=False
DisableRedirections=False
SharePointApplication=http://SharepointSite/_vti_bin
SharePointListView={8E6124E0-23F2-4BA2-86E7-96E7F36BAEC8}
SharePointListName={14C4ED2B-3050-4C47-B5F3-6333C3B0FB28}
RootFolder=/Lists/My list
You can take the third line which is -
http://SharepointSite/_vti_bin/owssvr.dll?XMLDATA=1&List={14C4ED2B-3050-4C47-B5F3-6333C3B0FB28}&View={8E6124E0-23F2-4BA2-86E7-96E7F36BAEC8}&RowLimit=0&RootFolder=%2fLists%2fSharepoint%20Sites
And use that to retrieve the complete list. I added an new receive data connection, selected an xml document and added the above URL.
It is not formated particullary nice but it will return all the data that I was expecting.
I think that Argalatyr solution is much simpler at this point, but it depends on if i am able to get the default view changed.

there is yet one workaround of this without such hardcoding. If you open Query editor, then you have there available ribbon with menu items. Open "Home" -> "Select top rows" and enter there some realy high number (I have in my list 596 rows, so I entered there as limit of top rows 20000 and I got whole list).
Sorry, I don't have available English version of Excel, so I cannot add screenshots.
enter image description here

Related

Sharepoint 2013/2016 Calculated Column stops calculating

I have a calculated column in SharePoint On-Premises that shows the number of days till a due date which works perfectly for a day or so then stops calculating, but if I go to the list settings and click the column and click ok then it calculates again?
Has anyone experienced an issue similar to this. I had this issue in both 2013 but within a few weeks moved to 2016 and still the same issue.
I've tried " " blank and also "" empty so not sure if that is causing the issue??
Is it a problem with the formula?
Here is the formula:
=IF(ISBLANK([Due Date])," ",
IF(ISERROR(DATEDIF(NOW(),[Due Date],"d"))," ",DATEDIF(NOW(),[Due Date],"d")))
Calculated columns cannot contain volatile functions, which includes those that depend on the current date.
The values in SharePoint columns--even in calculated columns--are stored in SharePoint's underlying SQL Server database.
The calculations in calculated columns are not performed upon page load; rather, they are recalculated only whenever an item is changed (in which case the formula is recalculated just for that specific item), or whenever the column formula is changed (in which case the formula is recalculated for all items).
If you need to show a dynamic value that changes with the passage of time, you have a few alternatives.
Client-Side Rendering
Consider using client-side rendering which lets you use JavaScript to dynamically determine how records in a list view are displayed. This JavaScript runs upon page load, so it can handle current time-dependent values much better than a calculated column.
To use client-side rendering, you create a JavaScript file that controls how the view displays. You upload that file to somewhere on SharePoint where people will have at least Read access to it, then edit the list view web part that you want to display differently and set its "JSLink" property to point to your JavaScript file.
Check out this answer for an example of using a JSLink file to spoof a dynamic date field.
Microsoft also provides some documentation here but I think they do more work than is necessary (creating an entire new list definition project in Visual Studio for their example instead of just creating a JSLink JavaScript file for an existing list).
Other Options
A few other options are mentioned in the older question linked above:
Conditional Formatting: You can apply conditional formatting to highlight records that meet certain criteria. This can be done using SharePoint Designer or HTML/JavaScript.
Filtered List views: Since views of lists are queried and generated in real time, you can use volatile values in list view filters. You can set up a list view web part that only shows items where Created is equal to [Today]. Since you can place multiple list view web parts on one page, you could have one section for today's items, and another web part for all the other items, giving you a visual separation.
A workflow, timer job, or scheduled task: You can use a repeating process to set the value of a normal (non-calculated) column on a daily basis. You need to be careful with this approach to ensure good performance; you wouldn't want it to query for and update every item in the list if the list has surpassed the list view threshold, for example.
To expand on the Filtered List Views option, you can have a view that shows only items that are due within a certain number of days. For example, you can display all the items due within 7 days by filtering where the Due Date field is less than [Today]+7 and Due Date is greater than or equal to [Today]. You could also sort the view to show the items with earlier due dates closer to the top.

Append Query From Access Into Linked SharePoint List with Lookup Fields in SP List

I am trying to append records in an MS Access table (I am using Access 2010, but can use 2007 if need be) into a linked SharePoint list.
There is an attachments field (when viewed from Access), but I am not concerned with appending these.
The SharePoint list has a few lookup fields, that in design view are of the Number format. Upsizing to SQL Server, I can confirm that they are numbers (and I assume the Id for the related SharePoint list object).
I copied the structure of the SharePoint list and pasted into a MS Access table, and then filled in a few sample records
I used the query wizard to select all of the fields of the Access table (minus the Access table's autonumbered ID and attachments), click "Append", and then selected the SharePoint list.
If I run this query, I get the error that X record(s) were not appended due to validation violation reasons, which is all of them. I've checked all field definitions and none are defined as required or have a validation constraint.
The only thing I can think of is that there is some issue with the Lookup fields, but each number Id I've checked is a valid Id.
I'm hoping for a MS Access solution, but if the only approach is to programmatically do it, could someone send me directions on how to get started with the SharePoint 3.0 SDK?
Thank you for your time.
Lookup columns are not number type even your parent items are of number type reason behind lookup column always attaches the item id of parent item.If you want to see the data in access kindly use the "export to Access" functionality available in datasheet view
I have linked to a SharePoint table, then appended directly to it from a query.
My issue is that this process takes a very long time to push up to SharePoint, then 2 times as long when first I need to delete the records currently in the list before appending.
Is there a better way to blow out and create the table while preserving the link since it is not an Access object?
Anyway I hope this may help you out some and get me some insight as well.
Regards.

Sharepoint custom list, dynamic field?

Hey guys, just wondering if their is a simple way to create an Item in a custom list but i need that item to be dynamic. The user can click add more to get another field that would hold the same type of data an unlimited amount of time.
If i could even just add an excel spreadsheet type of field that would work also. But excel wouldnt need to be a requirement on the users machine.
I thought i had read somewhere you could do this using info path but i cant seem to find anything relating to it on google.
The InfoPath feature is called a "repeating section". There is information on how to set that up in Office Online.
If you wanted to achieve this entirely in SharePoint, the problem is that there can only be a fixed number of fields in a list. So you could create as many that would ever be used and just display all of those. Or to make it much nicer for the user incorporate jQuery to hide all of the fields except the first one and provide a button for them to click that unhides the next one.
There is good information on how to access list form fields using jQuery in the question How can I set the default value in a SharePoint list field, based on the value in another field?

InfoPath 2007 drop down populates from MOSS07 list, but doesn't Alphabetize

We have an InfoPath 2007 form that populates a drop down from a SharePoint 2007 list of Employees. However, when opening the form in the browser (like it is designed to do) it does not alphabetize the drop down. But if i open the form on my computer, it does. Anyone else come across this issue and have a solution to it? I am wondering if it has to do with the indexing of the list, where if opened in the browser, if it sorts by the ID number that is assigned, where when on the computer it sorts by value.
Instead of adding the List as a Data Source, add the Data View XML of the list as the data source.
You can locate the Data View XML of the list by using this URL:
<Site URL>/_vti_bin/owssvr.dll?Cmd=Display&List={<GUID of the List>}&XMLDATA=TRUE&SortField=<Internal name of the Field that you want to Sort>&SortDir=Asc
Use this XML file as the data source in your InfoPath form, the dropdowns will be sorted according to the field you have specified.
Looks like View-based sorting is not supported in browser-enabled form templates because it requires manual hand editing of the view XSL file Refer
Options you have are
Hand edit the xsl
Write custom code on the load event and sort it
For more tricks refer to this link
One good example that works like charm is here

SharePoint list based on another SharePoint list

I have a list in SharePoint that contains several fields. I need to do some calculations on this list (filter and count) and display the results on a different page. We are currently using SharePoint 2007.
I can't get what I need by creating a view from the list. I need to create a new list based on the first list to get the proper level of filtering.
The result I am trying to get from this view needs to be displayed on a separate page.
Since you edited with "I need to create a new list based off the first list to get the proper level of filtering" I would suggest writing a console app with some CAML to query exactly what you need and then dump that into a new list.
However, it sounds like you could be using some calculated columns and then do what Moo suggested.
I think some more details about the question would help you get a better answer.
In the list settings, you can add filters and counts/totals/sums to the view.

Resources