Lookup Fields/Related View

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
Jdubs
Posts: 73
Joined: Fri Dec 19, 2014

07 Aug 2015

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.

User avatar
rostislav
Moderator
Posts: 364
Joined: Mon Oct 19, 2015

10 Aug 2015

1. You can populate the field using the appropriate function from this list:
http://spform.com/forms-designer- ... eld-values

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/librar ... e.14).aspx

2. The how-to for this task is described here:
http://spform.com/office-365/filt ... point-form

Jdubs
Posts: 73
Joined: Fri Dec 19, 2014

10 Aug 2015

Thanks rostislav :)

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:

Create Lookup Field based on field within current list (I need to filter based on current field)
Drag Related Items onto Form (I did this for both New and Edit during testing --> neither worked)
Configure Related Items to be filtered based on Lookup Field I created
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.

User avatar
rostislav
Moderator
Posts: 364
Joined: Mon Oct 19, 2015

10 Aug 2015

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
Posts: 73
Joined: Fri Dec 19, 2014

17 Aug 2015

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!

User avatar
rostislav
Moderator
Posts: 364
Joined: Mon Oct 19, 2015

17 Aug 2015

That's perfect, thanks so much.


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


As always, thanks so much rostislav!

Jdubs
Posts: 73
Joined: Fri Dec 19, 2014

28 Aug 2015

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?

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 21 guests