New answers tagged

0

Note: the above code only displays something in the View, it does not save any value if I set Status-> "Closed" it should show previous calculated column data which is "7 days Past" That is not possible this way, as Calculacted Columns always calculates You need an (on change) Workflow solution that saves the date when Item was Closed to a separate ...


0

Maybe this will help anyone who doesn't want to use css or javascript magic and just use OOB SharePoint columns. For me multiline text field with enabled rich editing *including HTML) worked nicely. I just putted in as field value html generated like this: private string GenerateUrlLinkForMultilineTextField(string url) { return "<div class='...


0

I would probably turn on versioning (major and minor), require content approval, and set "Who should see draft items" to "Only users who can approve items." Then I'd write a workflow that first checks the category. If the category doesn't equal OFF or Schedule Change, publish and approve a major version. Else, look up requestor's manager from user profile ...


4

OnPostRender: function (ctx) { var rows = ctx.ListData.Row; var sum = 0; for (var i = 0; i < rows.length; i++) { var value = rows[i]["FieldInternalName"]; sum = +sum + +value; } alert(sum); } Can be condensed to: OnPostRender: function (ctx) { ...


0

You may use client side rendering OnPostRender to sum up all the values of a particular column. Use the below code. (function () { var option = { OnPostRender: function (ctx) { var rows = ctx.ListData.Row; var sum = 0; for (var i = 0; i < rows.length; i++) { var value = rows[i]["...


0

I'm not 100% clear what you're asking, but if I've interpreted you correctly, you should be able to add separate column values together (i.e. =([Column 1] + [Column 2] + [Column 3]) etc.). You may have to convert to a numeric value if they are "Single Lin of Text" columns, and also check for empty values as well in this scenario. If you're looking to add ...


1

There is no limitation for Calculated columns. When you save the list as template which contains a calculated column it behaves normally. You will be able to save the list template and recreate a new list using that template. The newly created field also has the Calculated column with same formula. Similarly when you save the site as template and reuse it, ...


0

This was accomplished by creating a custom refiner. The code used was: The supporting JavaScript file (My_Filter_InactiveActive_functions.js) was function applyActiveInactiveRefiner(val, refinementCtrl, refinerName, strQuery){ var refiners = {}; refiners[refinerName] = null; refinementCtrl.updateRefiners( refiners ); if (val == 1){ // Active ...


0

Another place where formula can be added is under List/Library settings -> Validation Settings. Check if you are referring to any non-existing column.


0

Yes, you can The Calculated Column can output HTML, but only in Views! Not on Forms! Here is all answers I have given in the past year: http://sharepoint.stackexchange.com/search?q=user%3A32871+ICC Start with this one: Change entire row text color?


0

The syntax for displaying an Image with a Calculated Column (in a View only) is: ="<img src='image.gif'>" (you need to set the Datatype to output as anything but Text, different datatype will output different Alignments) There are 3 default images available by SharePoint as ="<img src='/_layouts/images/kpidefault-0.gif'>" ="<img src='/...


1

You can use the following formula: =IF([Product cost] - [Materials cost]>0,[Product cost] - [Materials cost]&"<img src='https://cdn2.iconfinder.com/data/icons/splashyIcons/arrow_large_up.png'>","") (since your icon URL is invalid, I changed it to the URL of an icon on the internet) Don't forget to set the data type of the calculated column ...


0

=If ([Product cost] - [Materials cost] > 0,[Product cost] - [Materials cost],"") This formula will give you the difference of [Product cost], [Materials cost] if it is greater than zero, else it will be blank. To combine what you want, try this formula. = '<img src="/_Layouts/images/kpidefault-"' & If ([Product cost] - [Materials cost] > 0,...


2

Make it a boolean. Tested it out on my end and this is what worked. sitecollection/_vti_bin/ListData.svc/TestList?$filter=IsNum eq true


0

We could not get the current list/library name using the calculated column, as the calculated column do calculations based on other columns. As a workaround, you can use the workflow to achieve it. But you should have a static length of folder names, and use the Extract Substring from End of String action. If you choose to go this route you can set it to ...


0

You have to compare a date to a date, not a string. Try this: =IF([StartDate]>DATE(2016,06,01),"4/26/2017","") Dates can't be set blank through a workflow. It worked fine for me with a calculated field. This also worked fine for me for a "Date and Time" field... it doesn't have to be date only.


0

Please check below options first. StartDate of type Datetime with date only option. Choose The data type returned from your formula must be DateTime. Than Below formula. =IF([StartDate]>=Date(2016,03,31),Date(2017,04,26),Date(2010,01,01))


1

Danny Engelman has a very good list for tested and tried functions for calculated column. You can view the list here: http://www.viewmaster365.com/365coach/#/Calculated_Column_Functions_List


1

There's a great Dev Center resource that provides a list of Calculated Field Formulas. I've used it to calculate date values, do basic math, and concatenation.


0

You cann't work with columns like Today() or Now() in calculated columns. But calculated columns can be handy in many scenarios, i.e. If you have fields like lets say, red, green, yellow indicators, you can easily use HTML in calculated columns to show, red, yellow or green images based on categories. Also, you can play around with mathematical ...


0

Calculated columns cannot contain volatile functions like Today and Me. You can use Excel to built the formulas and use it in SharePoint. Here is a walkthrough http://techtrainingnotes.blogspot.in/2010/08/sharepoint-creating-calculated-column.html?m=1


3

You don't have to go the CSR route but some JavaScript is required. You already know the HTML in Calculated Column trick... Let's extend that, the data you are after is in the global ctx object disclaimer; I did not test this exact code, might be typos ="<img src=""/_layouts/images/blank.gif"" onload=""{" &"var TR=this.parentNode.parentNode....


2

Fixing your syntax: =IF( [Hourly rate]>160 ,4 ,IF( AND( [Hourly rate] >145 , [Hourly rate] <160 ) ,3 ,IF( [Hourly rate]=145 ,2 ,IF( [Hourly rate]<145 ,1 ) ) ) Better: =IF( [Hourly rate]<145 ,1 ,IF( [Hourly rate]=145 ...


1

Please try below formula. It will work as per your need (Explained in question). =IF([Hourly rate]>160,4,IF(AND([Hourly rate] > 145,[Hourly rate] <160),3,IF([Hourly rate]=145,2,IF([Hourly rate]<145,1))))


3

SharePoint stores dates as integer count starting at 1/1/1900 So =EndDate + 15 gets you 15 days from your EndDate To format Dates different you can use the TEXT() function =TEXT( EndDate+15 , "YYYY/MM/DD" ) Function documentation: http://viewmaster365.com/365coach/#/Calculated_Column_Functions_List



Top 50 recent answers are included