Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

infopath formula

Posted on 2011-03-15
3
1,032 Views
Last Modified: 2012-05-11
Dear Sir
i create a form in infopath and connected to sharepoint form, all thing work fine.
i creata a field name "user" and i create a rule for this field from the infopath rule to display the username of the current user.
i use username() as rule.
and it is working fine, when a user from sharepoint open the form , his username is displaying in the "user" field.
but now i want to create a second field named "name" to display the name of the current user .
There is a list in sharepoint named "user information list" which contains all the information about users ( first name,last name,username, display name, company .....)
i want to create a rule in infopath for this field "name" to display the name for the current user using "user information list" .

how can i did it ??
0
Comment
Question by:spring80
3 Comments
 
LVL 7

Expert Comment

by:AlMothanaAlOmari
ID: 35136068
Hi
you can achieve this by using infopath code behind , you should write a code to expose sharepoint list then to read fro this list and write the field that you want  .

http://platinumdogs.wordpress.com/2010/06/21/sharepoint-using-the-sharepoint-object-model-with-infopath-form-code-behind-part1-of-2/
0
 
LVL 28

Accepted Solution

by:
clayfox earned 500 total points
ID: 35137572
You can do this in InfoPath without any code.

The key is filters.

When you set a fields value or make a default with a function.  Go to the user list and select the field with Display Name. Before selecting OK use the button on the lower left called filter.

Add a filter
Username = username()

This way you will get the display name from the list where username in the list is equal to the username() of the person opening the form.
0
 

Author Closing Comment

by:spring80
ID: 35139077
it is working ,thanks youu.
very good solution
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Sharepoint List View 6 36
File size limit in SharePoint 2010 5 50
Providing anonymous access to pdf form only - sharepoint 2013 9 68
Access Web App or PowerApp 24 33
When installing SharePoint 2010 RTM I came across a strange error, I was getting timeouts during the installation. I searched the web and found the best solution to be found here (http://social.msdn.microsoft.com/Forums/en-US/sharepoint2010genera…
The vision: A MegaMenu for a SharePoint portal home page The mission: Make it easy to maintain. Allow rich content and sub headers as well as standard links. Factor in frequent changes without involving developers or a lengthy Dev/Test/Prod rel…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

856 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