Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Get the current form list column name and fill it by another custom list field

Posted on 2013-01-28
4
Medium Priority
?
355 Views
Last Modified: 2013-02-05
Dears,

 I have SharePoint 2010 Form Library. When loading this form library, I need to fill some fields like name, department, hire_date from another custom list  where all these information are already exist. Both forms are identified by a unique ID.

How to do these by using Visual Studio Loading Event option (under developer tab) by InfoPath 2010?
0
Comment
Question by:mshaji
  • 2
  • 2
4 Comments
 
LVL 50
ID: 38829818
Hello, you need to define a data connection to the other list. Then create a rule that fills the fields when the key field changes. Filter the data source by the key field. To do that, set a field value in the secondary data source, using the appropriate field in the query field group. Then query the data connection. After that simply set the main data source fields with the values of the (now filtered) secondary data source fields.

Code is not required for that.

Cheers, teylyn
0
 

Author Comment

by:mshaji
ID: 38829871
Thanks for the supoort dear,

I am not getting your points. Can you explain it in details please.

Lets say, I have Custom list Named: New_Arrival_Form  (First list) with fields Badge_No, Name, Nationality, Designation, Grade, Hire_Dt  

I have another list named: New_Arrival_Form_Evaluation (Second list) with fields New_Arrival_Form_ID  (this is the ID of the custom list), Badge_no, Name, Nationality, Designation, Grade, Hire_Dt

Now, when a user click a row record of the  fist list then the page will redirect by passing the ID of the first list  to the second list.

and when the second list loads then it will fetch the data from the fist list by using the passed ID and will display in the fields of second list like Badge_No, Name, etc

I hope this will clear my goal

Regards
0
 
LVL 50

Accepted Solution

by:
Ingeborg Hawighorst (Microsoft MVP / EE MVE) earned 2000 total points
ID: 38830180
Edit the list form for the second list. The fields in that list are the main data source. In the field panel on the right, underneath the list of fields, click "Advanced View".

Create a new data connection and point it to the first list. Include all the fields that you want to look up and also include the ID field of the first list. This data connection is the secondary data source.

Create a new rule for the field New_Arrival_Form_ID. The rule should be executed whenever the field changes. Create the following actions:

Set a field's value
- Field: select the secondary data source, open the query fields node and select the ID field. If you don't see a drop-down to change the data source, click "Advanced View" below the list of fields.
- Value: select New_Arrival_Form_ID from the Main data source

Query for data
- select the data source for the first list

Set a field's value
- Field: Badge_no field in the Main data source
- value: Badge_no field from the data fields node of the secondary data source

Set a field's value
- Field: Name field in the Main data source
- value: Name field from the data fields node of the secondary data source

repeat for the other fields.
0
 

Author Comment

by:mshaji
ID: 38853907
Some part helped
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Scenario: Let’s say you have a quote worksheet in Excel that you use to work up sales figures and such for your clients. You utilize SharePoint to manage and keep track of these documents. You would like values from your worksheet to populate Sh…
I thought I'd write this up for anyone who has a request to create an anonymous whistle-blower-type submission form created using SharePoint 2010 (this would probably work the same for 2013). It's not 100% fool-proof but it's as close as you can get…
Loops Section Overview
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question