question

CindyMello-5714 avatar image
0 Votes"
CindyMello-5714 asked GB-8837 answered

sharepoint list custom edit form show related lookup column field values

I have a list, and use a lookup list to populate a drop. the Lookup list has 3 fields, plus id

In the parent list the columns pulled from lookup are
Company
Company:Address
Company:City

I can select the Company and save in New form and in the list I see the related values.


Be when I open the Edit list the fields (would be read only). only Company is there
Company:Address
Company:City

When I select the company either in New or Edit form I want to see the related values and then click save etc.

I am using a solution to created and display fields in a custom form.
https://www.markrackley.net/2013/08/29/easy-custom-layouts-for-default-sharepoint-forms/

So I think this will have to be a javascript? Example for the JSON?
I get from the parent list the company name and do api call to related list to get the value array?

I can see it but am very bad with scripting. any examples would be very helpful and appreciated.

Cindy

dotnet-csharpsharepoint-devoffice-js-dev
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

The field values I want to see on both the new and edit forms after selecting the lookup
are the secondary field values. They populate correctly in the list.

0 Votes 0 ·
EmilyDu-MSFT avatar image
0 Votes"
EmilyDu-MSFT answered EmilyDu-MSFT commented

@CindyMello-5714

Here're steps:

1.Create a parent list named "Company". Then create Company, Address and City columns in the list.
114996-1.png
2.Create a list named "lookup". Then create a lookup column named "Company" in the list.
114997-2.png
3.In the lookup list, click ribbon -> List tab -> From Web Parts -> Default New Form -> Add a Web Part -> Media and Content -> Script Editor -> Edit Snippet -> Add codes in the txt file115024-codes.txt.
4.Result:
115031-3.png


If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



1.png (7.5 KiB)
2.png (31.2 KiB)
3.png (3.8 KiB)
codes.txt (1.9 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@CindyMello-5714

Do you have any progress on this issue?

Please remember to update this thread if you need further assistance.

0 Votes 0 ·
GB-8837 avatar image
0 Votes"
GB-8837 answered

@EmilyDu-MSFT
This is really helpful, thank you. The part I can't find is

the lookup list, click ribbon -> List tab -> From Web Parts -> Default New Form -> Add a Web Part -> Media and Content -> Script Editor -> Edit Snippet -> Add codes in the txt file115024-codes.txt.

Where do you find the "list tab" and "From Web Parts" section? Is this from the list page itself? If so I don't seem to have that option.
thank you.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.