1

I am attempting to do conditional formatting in a list view in SharePoint Designer. In this list I have a list that contains a lookup column, and other columns derived from the list of that lookup column. In the source list, the columns Hours, cycles, APU Hours are all numbers; Date In is a date (asterisks are there to draw attention)

partial view of the columns in my list

The data in the list/view is pulling correctly, but does not appear to compare when building the condition in SharePoint Designer

The clause in the condition appears as such in xpath notation: $thisNode/@Due_x0020_Hours. <= @Registration_x003a_Hours_x0020_I

conditions

Do lookup columns retain their data types (that is can numbers be compared against other numbers?); and can lookup columns be used in conditional formatting? Or is there a special notation that has to be used for conditional formatting?

1 Answer 1

1

You will probably find that the lookup is stored as a link back to the original list item so you will need to remove that additional formatting before you can do a comparison.

Something like this should remove any HTML tag around the value:

substring-after(substring-before(@Registration_x003a_Hours_x0020_I,"<"),">")
2
  • That is to have "$thisNode/@Max_x0020_Hours. <= /dsQueryResponse/Rows/Row/@Registration_x003a_Cycles_x0020_" as the only clause/condition? Doesn't appear to work. I also tried converting the link to a number, but that doesn't work either
    – marcwenger
    Jan 13, 2014 at 18:28
  • Put both values on your page and compare the HTML that is actually rendered using something like Developer Tools (F12 in IE). You will probably find there is an <a> tag surrounding the lookup value so you will need to strip this out. I have added a suggestion in my response above though it may need some tweaking . . . Jan 13, 2014 at 20:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.