Lookup Fields/Related View

rss

Posted by Jdubs - Aug 7 ’15 at 04:47

I give up :(  I've spent this week researching this forum and trying to get my Related Views to work right, but I'm just missing something.

 

Here's the 2 main things I'd like to do:

 

1) Instead of the Lookup Field/Plumsail Look field being a drop-down list, I'd like to populate the lookup field by default.  (Ideally, I'd like to populate it with the last value entered on the SharePoint list.)

 

2) On a New Form, I'd like to see a list of related items based on entry into a field on the form.  (I can't even get this to work on an Edit Form).

 

Thanks y'all - your help is so much appreciated.

  • rostislav
    rostislav
    Moderator
    Member for: 4 years 1 month 13 days
    #1 by rostislav Aug 10 ’15 at 04:58

    1. You can populate the field using the appropriate function from this list:
    http://formsdesigner.blogspot.ru/2013/04/getting-and-setting-sharepoint-form
    .html
    For example, if your field is a single cross-site lookup field you place the
    following code in the JavaScript editor for your page:
    fd.field('CrossSiteLookup').value({Id: 1, Title: 'Item 1'});

    If you want to assign the last added/edited item from a list, you can query
    the list using CAMLQuery (and then assign it to the field). You can read
    about how you can do that here
    https://msdn.microsoft.com/en-us/library/office/hh185007(v=office.14).aspx

    2. The how-to for this task is described here:
    http://formsdesigner.blogspot.ru/2015/01/filter-related-items-by-almost-any.html

  • Jdubs
    Member
    Member for: 4 years 6 months 1 day
    #2 by Jdubs Aug 10 ’15 at 05:57

    [#1]: Thanks rostislav smile

     

    For your answers to 2), that's the link I worked with last week to try and get the Related Item views to work (should have mentioned that in my original question).

    I'm not sure if A) I'm doing it wrong, or B) my Forms Designer version (2.8.9) is preventing me from getting the desired results.

    At a high level, here's the steps I did:

    1. Create Lookup Field based on field within current list (I need to filter based on current field)
    2. Drag Related Items onto Form (I did this for both New and Edit during testing --> neither worked)
    3. Configure Related Items to be filtered based on Lookup Field I created
    4. No Items are returned.  I re-saved items in my list with a value of the newly created Lookup Field, but no matter, no items are ever returned in the Related view.
  • rostislav
    rostislav
    Moderator
    Member for: 4 years 1 month 13 days
    #3 by rostislav Aug 10 ’15 at 07:23

    You don't need to use a lookup field for this. In the Data Source editor you need to select:

    -List- the list that the related items control will *reference*, not your current list

    -Filter by form field - needs to be selected

    -Form field - the current list's field that will be the filter by value. This doesn't need to be a special lookup field, just use the field from your current list that you want to use as a filter

    -List field - the *referenced* list field that will be compared to the filter by value. So, essentially if the value for your form field is 'Bob', the related items control will only display items from the referenced list with list fields that have value 'Bob'

  • Jdubs
    Member
    Member for: 4 years 6 months 1 day
    #4 by Jdubs Aug 17 ’15 at 07:46

    [#3]: Hmm.  Is this a Forms Designer version issue?  My responses below in bold.

     

    -List- the list that the related items control will *reference*, not your current list:  I want the related items to reference my current list.  I want to see everything in the current list that has the same account number as the current item.

     

    -Filter by form field - needs to be selected: I do not have "filter by form field" option.  The only option here (no matter how I change the options before), is "Filter by lookup field" ... which is why I created a lookup field previously to see if I could get it to work.

    -Form field - the current list's field that will be the filter by value. This doesn't need to be a special lookup field, just use the field from your current list that you want to use as a filter: I'm guessing htis relates to above comment:  I don't have option to filter by form field.

    -List field - the *referenced* list field that will be compared to the filter by value. So, essentially if the value for your form field is 'Bob', the related items control will only display items from the referenced list with list fields that have value 'Bob':  This is what I want, but ... I want the "reference list" to be the list that I'm currently in.  Is this possible, even if I were to have the correct Forms Designer version?

     

    Thanks man!

  • rostislav
    rostislav
    Moderator
    Member for: 4 years 1 month 13 days
    #5 by rostislav Aug 17 ’15 at 08:28

    [#4]: Sounds like you have an old version of Forms Designer, please update your Forms Designer to the current version.


    If I understand you correctly, in the related items control you want to display all items of the current list, filtered by a field (accound number). If so, after you've updated follow these steps:

    -add a related items control
    -go to Data Source editor (click on the control, click '...' against 'Data source')
    -select:
    --List - your current list
    --View - any view that contains your accound number field --Filter by form field - selected (after you've updated that's what it should be called)
    --Form field - your accound number field --List field - the same account number field -Click OK, click Save.

    That should do it. Does that solve your issue?

  • Jdubs
    Member
    Member for: 4 years 6 months 1 day
    #6 by Jdubs Aug 17 ’15 at 02:12

    [#5]:

    That's perfect, thanks so much.

     

    I've sent a request to update our forms designer.

     

    As always, thanks so much rostislav!

Displaying 1 to 6 of 6 messages