none
Page Field Filter having ;# in its value when filter is based on a Lookup column RRS feed

  • Question

  • Hello,

    We have a document library(A) and that document library has document sets in it.

    We have a webpart in the document sets which displays a different document library (B).

    We have a custom lookup column for document set in document library(A) that is based on a list and that list is used by document library (B) as well

    In order to filter the document library (B) view on each document set page we are using the Page Field Filter web part such that the Title of the document set is equal to one of the column value of document library (B) view.

    Now Title on a Document Set is single line text and we cannot edit/customize the new form aspx for document set.

    So, we though of using a custom column (lookup column) to drive the Page Field Filter instead of the Title, such that user can give any name they want in Name/Title but the drop down selection will drive the filter.

    We configured it accordingly to use that column, and the library view also gets filtered but unfortunately the filter value that gets used is like 6;#TestProject1

    The value should only be TestProject1, but as we are using teh column which is of type lookup it seem like the 6;# is kind of some pointer (ID) from the Lookup list

    We thougt of adding another column to document set library as calculated column (single line text), but calculated columns do not work wih lookup columns, so cannot use that.

    Is there a way to achieve this to filter the document libarry view using lookup column as the Page Field Filter

    Thanks

    Tuesday, October 9, 2012 8:33 PM

Answers

  • Hi Emir,

    Was this a complete tested solution?

    I have:

    - A source list with the column.  That sets the values for a site column.

    - Site column is used as a field in a list.

    - Site column is used as a field for a page.

    I want to filter a web part displaying the list on those pages: I figure to do that by a page filter web part.  As-is the filter does not work as it passes "ID;#Value", as stated above.

    So I've used your approach to copy the site column page field (a) via a workflow to a new page field (b).  Then a calculated column (c) strips off "ID;#" from b.

    But c can't be used as a page filter because it is calculated?

    A second workflow to copy c to a new column d seems crazy complexity.  I must be doing something wrong?

    Thanks,

    Cameron

    Wednesday, September 4, 2013 4:35 AM

All replies

  • Hi Sachin,

    Since we are unable to use lookup field in calculated column, we can first copy the lookup field to a single line of text field using SharePoint Designer workflow. Then extract the value from the single line of text field in calculated column with following formula.<//span>

    =RIGHT([lookup_field],LEN([lookup_field])-INT(FIND("#",[lookup_field])))

    Thanks & Regards,
    Emir


    Emir Liu

    TechNet Community Support

    Wednesday, October 10, 2012 9:07 AM
  • Hello Emir,

    I had read that suggestion on some other post before, but as we want to have it more real time I believe workflow may not be the best options in our case as it has delay to get that value updated unless we give users some control on the form to trigger.

    My main question was really on how the Page field filter webpart works, as that filter webpart seems to not understand the value from the lookup column and is adding the ID to the column value when filtering.

    So, basically its like the page field filter webpart itself needs to be customized to performing proper filtering when it is a value from lookup column and then it shuold work fine.

    But, I do not know if at all this filter can be customized or some other filter or script can be applied on top of it to just clean up the value and pass it to the document library view for filtering.

    Thanks for the suggestion

    Sachin Jog

    Thursday, October 11, 2012 7:28 PM
  • Hi Emir,

    Was this a complete tested solution?

    I have:

    - A source list with the column.  That sets the values for a site column.

    - Site column is used as a field in a list.

    - Site column is used as a field for a page.

    I want to filter a web part displaying the list on those pages: I figure to do that by a page filter web part.  As-is the filter does not work as it passes "ID;#Value", as stated above.

    So I've used your approach to copy the site column page field (a) via a workflow to a new page field (b).  Then a calculated column (c) strips off "ID;#" from b.

    But c can't be used as a page filter because it is calculated?

    A second workflow to copy c to a new column d seems crazy complexity.  I must be doing something wrong?

    Thanks,

    Cameron

    Wednesday, September 4, 2013 4:35 AM
  • I have answered my own question now.

    Solution was to still use workflow but instead of copying (a) to (b) as a string it should be done as a "Look up (as Text)".  Then the calculated field is not required and (b) can be used as a filter since it is a normal field.

    Wednesday, September 4, 2013 5:05 AM