I am using Nintex Workflow and SharePoint 2010.
I have date1 and date2. There are occasions when date1 may be 'N/A'. If date2 - date1 > 30 days the ROW for that item will be one color. If date2 - date1 <= 30 days the ROW is another color and if date1 = 'N/A' it will be another color. How can I do this in a workflow. I was going to do it in SharePoint Designer and I couldn't figure out how to do it there either.
Solved! Go to Solution.
If you need the conditional formatting on the List View, then the traditional way in 2010 is to use a DataView in SharePoint designer. You could use a workflow to support this by doing the formula for you and assigning a value to a custom field to mark the color, but this can be accomplished in the DataView without it. A calculated field on the list item can probably accomplish the same thing a workflow calculation.
I've done conditional formatting before. However, it was just based on another field's value not the calculation of two fields. And I didn't format the whole row just a single cell.
I'd upgrade to 2013 and use a display template!!
But in 2010, I probably would not use a workflow unless I couldn't get the value(condition) I needed for the DataView.
I didn't think of this at first, but even in 2010 you can use JQuery to change styles of elements. Review this if it is an option.
here is an example I found
This example shows that you can query for an element based on attributes and then change the selected element's styles.
Unless I'm missing something, I don't think this will work. This is based on a SharePoint date field subtracting the current date then formatting the color. Based on the results of the calculations it will then determine the color. This thing has been on my nerves for TWO days. I'm now ready to throw my PC across the room! To make things worse, SharePoint Designer shows different results than the browser does! Ughhh!
Here is maybe and idea (please let me know more about what you need to do if I am way off here): Inside of your workflow perform the date calculation. Have another column that you can update with the color that you want this row to be as a result of your date calculation. For example: Column named "Color" specify "Red" then have whatever code you are using to change the row column color to be based on the color specified in this column.
Hopefully this helps?
I hope that didn't hold you up, I mentioned that on the 19th.
The jquery could perform the calculation for you and then set the color, or look for a color value in a field and then set the color it wouldn't matter. I believe both possibilities could be accomplished with a dataview webpart as well.