What is the maximum amount of cells you can set when using Excel REST API with SharePoint Online? - sharepoint-online

I'm trying to use the Excel REST API with SharePoint online to set some cell values and to retrieve some calculated fields.
It seems this goes well up until passing 10 cell values. When passing more I get a 503 Service Unavailable back from the API.
The amount of characters in the URI is less than the approximant supported 2000 characters.
Any limitations on the maximum amount of fields you can set is not described in the documentation https://msdn.microsoft.com/en-us/library/ff394477.aspx
Example:
https://business-my.sharepoint.com/_vti_bin/ExcelRest.aspx/personal/john/documents/some.xlsx/model/Ranges('Input_Output!S2|S13')?$format=atom&Ranges('Input_Output!C3')=val1&Ranges('Input_Output!C4')=val2&Ranges('Input_Output!C5')=val3&Ranges('Input_Output!C8')=val4&Ranges('Input_Output!G2')=val5&Ranges('Input_Output!G3')=val6&Ranges('Input_Output!G4')=val7&Ranges('Input_Output!G5')=val8&Ranges('Input_Output!G6')=val9&Ranges('Input_Output!G10')=val10
Any help is much appreciated! Thanks.

Given that this API takes in the input data in the URL, the number of input cells is limited.
Have you looked in to the new EXCEL REST API that is now available as part of Microsoft Graph? This does allow large input cells.
Check this API:
https://github.com/OfficeDev/microsoft-graph-docs/blob/master/api-reference/beta/api/range_update.md
http://graph.microsoft.io/en-us/docs/api-reference/beta/api/range_update

I could only get one cell updated and that was in the download, not in the source document. That would have been fine if I could have counted on the user to save it back. This is not guaranteed. I am not the ultimate or penultimate authority so keep looking.

Related

Is there a way to use Sharepoint version history to make a calculated column value?

I cannot see a way to do this natively, but essentially I would like to tap into the version history for a specific field value to calculate the difference between the current value and the last entered value.
Scenario:
Business user will update a numeric value in a column for each list item once a week to a cumulative amount. (i.e. Sales made to date)
I am currently able to see in the version history what the last entered value was, who entered it, and when it was entered. I want to know if there is a way to access this information in the form of a calculated column to find this difference (i.e. sales made this week). The solution I am thinking is adding another column for "Total Sales Last Week" and have the user manually update that when they update "Total Sales This Week" then have a calculated column to just subtract these values. However, this seems tedious since the information is already in Sharepoint. If there is a way to do this either with a calculated column, PowerAutomate flow or another method please let me know.
It is not possible to capture the Version History using calculated column. REST API is the only option that will be helpful to fetch these details. Considering this, there are two solutions that I can suggest here:
Using REST API
Create an additional column in your list and update it with the data that you will capture from version history using SharePoint REST API. Here, Rest API will be used to fetch the version history and also to update the list item.
As a trigger event to execute this code, Either you can setup a button on the page (if using any custom screen) or set this to execute periodically.
Using REST API in Power Automate (Recommended)
Power Automate/MS Flow doesn't provide any direct connector to fetch the version history but you can use the HTTP request connector which will help you to execute the SP rest call to fetch the version history.
Once you have version history data from your HTTP request call, you can use that to update the column in your list using the same power automate in next action.
This solution will be more useful as you don't need to setup any trigger event as mentioned in the first solution but instead of that you can simply configure this Power Automate to run as and when list item is updated and you will be having immediate result in your list.
You can refer to this link to check how to get data from HTTP request using Power automate and you can also refer to this link which will help you to understand how to get version history using SharePoint rest API.
I hope this will be useful information for you to achieve your goal.

How to filter Sharepoint list in Flow by current date plus days?

I've got a Sharepoint list tracking items and renewal dates associated with them. I want to utilize MS Flow to get just the items from that list (which will eventually have about 200 items in it) that have a renewal date 60 days from now, and send an email with the info from the list. This would recur every day.
The recurring feature works fine, as does the list and email.. My issue is with filtering the list down. I had hoped to be able to use views I created in the list, couldn't find a method for that, so I've resorted to attempting to utilize the ODATA filtering option.
I use the AddToTime feature before grabbing the list to get the 60 days out date (which is returning the correct value based on the error string), but no matter what I get invalid expression when it runs on the filter.
Any guidance on this?
This is Sharepoint Online and Flow Online. An example query string that I've used is Renewal_x0020_Date eq [insert the output from the Add to time flow item before].
RESOLVED!
Turns out, all I had to do was place single quotes around my object for the calculated date/time in my ODATA filter.

Can I use Excel WEBSERVICE to scrape specific content from a page?

I'm trying to import data from Yahoo Finance into a spreadsheet.
If I enter this in Excel...
=WEBSERVICE("https://finance.yahoo.com/quote/GOOG/")
...it returns a #VALUE! error because the content of the page exceeds the character limit for a single cell.
I only need the Yahoo Finance value listed after "Previous Close." Since this amount--presently 987.83--is well below the Excel cell character limit, is there a way to modify the function to return just that amount?
Thanks!
In my opinion, WEBSERIVCE is used more along the lines of retrieving JSON or some sort of API endpoint. Your trying to parse an entire HTML page. So yes, you can use WEBSERIVCE to scrap content, but your specific page is returning too much data to handle.
Per the remarks here:
If arguments result in a string that is not valid or that contains more than the allowable cell limit of 32767 characters, WEBSERVICE returns the #VALUE! error value.
If url is a string that contains more than the 2048 characters that are allowed for a GET request, WEBSERVICE returns the #VALUE! error value.
I would suggest using a traditional Query where you can manipulate the webpage as desired.
And then you can grab the table as depicted below. Further more, this content will refresh dependent on the settings you allow:

excel lookup that alters URL for web based data pull

I've been trying to figure this out for 5 days, searched this site, watched youtube tutorials, and it's just not coming together for me. I know very little excel and no visual basic.
I need to be able to pull specific info from a website and populate an excel sheet with that info.
User-entered data (the variable?) is an email address. I have a long list of email addresses. From this list I want to generate the web data pull.
My excel is currently set up as a form, Column 1=email, that is the info I have. What I want to pull is in columns 2-8: 2=id number, 3=first name, 4=last name, etc.
The site I am pulling from is an internal API, looks like: http://blah.web.blah.com/blah/blah/blah/emailAddress. This site displays each value that I seek as:
<id>12345</id>, <firstName>Joe</firstName>
The site has over 25 lines of info tagged like this, I am only interested in pulling 7 specific lines into the appropriate column and row, based on the email value in Column 1.
I can easily capture all 25+ lines of info, one at a time.
=HYPERLINK("blah.web.blah.com/blah/blah/blah/"&A3
I would prefer to do this as a batch where I paste the email addresses into Column 1 and walk away while the magic computer executes the batch.
...this seems like it should be easy, but I don't know how to do it and haven't found a solution that starts to function. And like a seasoned Russian once said, "What is hard? Everything you do not know."
If you have excel 2013 , you can use FilterXML function

fetch data from ms-access to ms-word

i am looking to create an invoice in either MS-excel or MS-word. This invoice will contain several fields like invoice no., customer name, product info, quantity, Amount, Date, Address of customer, phone no. etc. The function of the invoice will be, to generate a unique invoice number, every time i open it, and then the vendor will mention the customer's info, product's info and click on submit button or save it. The info mentioned in the invoice will automatically be saved in the MS-Access database whenever submit button is clicked or the document is saved.
Thus, All the records of the customer will be saved in the MS-Access database. whenever i need to search for a particular customer, i should be able to search it from either invoice no. or any unique field for that particular invoice. I hope my query is explained clearly. please let me know the easiest way to do it. I do not have the vast knowledge about this subject, so give me suggestions that are understandable by a Novice.
I think you are starting from the wrong end. Use an Access form to get the data and then run a mailmerge, the easiest way is to output a text file from Access as the data file and use a Word template for the merge.
An autonumber may suit for invoice number as long as all you need is a unique number. If you need documented sequential numbers, you will have to create then yourself. How you do it will depend on the number of users working at the same time.
I can tell you now, generating Word files with Access is a bit of a pain in the ass. If you really want to do formatting it gets hard (is my experience).
I ended up generating HTML files in which I could control everything, and opening them as .docs. But if you are really new to this, I suggest you start with some VBA tutorials, where they explain to you how you get records from you database and loop through them to generate output. And then you can start looking at file writing functions in VBA.
Can't find any tutorials real quick (my girlfriend is getting angry as we speak), but here is a sample:
http://www.access-programmers.co.uk/forums/showthread.php?t=25354
Just look around in fora, look for file generation and looping through records.
Hi just reading your post, like Remou l would strongly suggest you use Access to enter and store the data. It is possible to get a user to enter data into a spreadsheet and write the data back to Access DB. Not something l would recommend for the novice, here is a link to some code on how it could be done
Returning to your first question, of creating the invoice have you considered generating the invoices from Access using a report? They can be printed to PDF, or exported to various electronic formats. Or is there specific reason to use Word/Excel? If are going down the route of using Word to generate the invoice then use a template as Remou suggested. See this link for some samples see the section titled Access > Word. I have used the examples as a basis for Access to Word. A number of the examples though use a tecnology called DAO, which l understand will not be included in any operating system after Windows 7. Just something to be aware of.
Searching for a record in a database table this link has one possible solution . Also the author has included a example database.

Resources