Infopath codeless programming (walkthrough) 1
Special thanks: Karl D. Swartzendruber
Other parts: 2, 3.
Bookmark that post
Let me guess what might have brought you to that blog page about codeless programming in InfoPath. Any of you who developed at least one sophisticated InfoPath form sooner or later have been realized that writing forms with real complex behavior is impossible without some sort of coding in C# or VB.NET. So developers have no choice but to deal with mixed developing environment like Visual Studio, managing form security levels, security certificates and so on. But there are people who like to keep things simple. At least I do. And that’s why probably you are reading that page too:)
Anyway, lets get to the business. How to iterate an Infopath Repeating table?
Here is our scenario: we have a repeating group on the form which will be populated with wonderful (but often overlooked) Contact Selector Control with some user information. The control provides us all necessary information about user except his email.
But wait, that is outrageous! The email was the only reason why we decided to use that now not so awesome control! Well… at least we have access to the web service which able to return user email in exchange of account name. There are countless blogs describing how to utilize UserProfileService to get info of a single user in Contact Selector. Here I’ll try to demonstrate how to deal with multiple selection in Contact Selector. So now our task is clear – we have to construct a string acceptable in Email address field iterating through repeating group and submitting query to the web service on each cycle of iteration.
Let’s go.
The first things first – here using-the-contact-selector-control you will find detailed explanation how to utilize Contact Selector Control. The resulting data structure for the control in main data source should look like this
The Control also requires secondary data source
Add text field named HlinkToEmail. That field will hold result of our computations. Resulting Main Data Source:
When your new shiny control starts providing you users from your network that means we are ready for the web service part. Here we’ll use SharePoint GetUserProfileByName web method. You will need SharePoint Services running somewhere on your network. That part is pretty straightforward. Add secondary web service receive connection. Your link in connection settings should look like
http://<youservername>/_vti_bin/UserProfileService.asmx.
The results of that part:
“Programming” part
Place a button on the layout. At Rules and Merge tab create rule named setfCounter. Press “Set Conditon”. In the first area choose “The expression”. Here is string to paste in second area:
count(my:Person)>0
The only action will assign initial value to the HlinkToEmail field. Press fx button at new action form. Check “Edit XPath (advanced)” checkbox. To avoid too detailed instructions of choosing functions and form elements just copy paste the following expression:
xdMath:Eval(xdMath:Eval(my:Person, 'concat(my:AccountId, "|")'), "..")
If you prefer more automated design (no button needed) the same expression above may be used as default value of the HlinkToEmail field.
At main data source pane double click at HlinkToEmail field. At Rules and Merge tab create rule named fConterRule. It’s a conditional rule. In the Set Condition dialog in the first area: Choose The expression. Then paste this expression into second area:
contains(., "|")
The resulting set of actions:
The rule will consist of 3 actions. The fist action will be setting AccountName field of data source named GetUserProfileByName to the portion of HlinkToEmail field. Check “Edit XPath (advanced)” checkbox. Paste Xpath expression:
substring-before(., "|")
Next is self-explanatory action. Add action -> Query using data connection -> Choose GetUserProfileByName.
Add the last action to set HlinkToEmail field to the new value by assigning following XPath expression:
concat(substring-after(., "|"), ";", xdXDocument:GetDOM("GetUserProfileByName")/dfs:myFields/dfs:dataFields/s0:GetUserProfileByNameResponse/s0:GetUserProfileByNameResult/s0:PropertyData/s0:Values/s0:ValueData/s0:Value[../../../s0:Name = "WorkEmail"])
We done with actions of that rule. Make sure that check box “Stop processing rules then this rule finishes” is checked.
Add the last rule right after fConterRule. In Set Condition dialog choose The expression. In expression area copy paste:
substring-before(., ";") = "" and contains(.,";")
And finally, set the HlinkToEmail to the following XPath expression:
substring-after(., ";")
That’s it.
P.S. Now you know how to iterate and read repeating structures. But what if you need to write? Well, InfoPath doesn’t provide UI to parameterize repeating structures are assigned to new values. Still here you will find a workaround which overcomes this limitation.
Posted under tags: MOSS Contact Selector Control Infopath Sharepoint
Good stuff – glad we were all able to work together to improve this solution and come up with a way to do it for InfoPath-only emails and for using SPD workflows to send the emails. Have you considered splitting it into those two sub-categories? The way I’m doing it for SPD is unbelievably simple compared to these steps, although yours are excellent.
Clayton - December 18, 2008 at 2:20 am |
Special thanks part is at the top and updated :) Sending emails in workflow is a good and legitimate practice. But my initial goal was just to show how “state automates” programming principles could be applied bringing significant advantages such as easy of deployment. After all 3 rules and 5 actions is not that big amount of work. :)
alecpojidaev - December 18, 2008 at 2:50 am |
hi,
I am using Contract Selector to send an email to selected personals and/or groups. it works if we select persons in contact selector but not for groups! Any idea???
Usman - December 18, 2008 at 1:39 pm |
There is SharePoint service which returns all members of a given SharePoint group. There are also bunch of Exchange server webservices (not tryed them yet). Getting information directly from AD will require to write custom webservice. Anyway combining web service data with that solution will allow to solve your problem.
alecpojidaev - December 18, 2008 at 6:51 pm |
Is there a way to send an email to the manager of the person’s name in the contact selector?
Nick - January 5, 2009 at 2:01 pm |
To: Nick
Shouldn’t be a problem. For example if you’ll replace “WorkEmail” with “Manager” in the main action like this:
concat(substring-after(., “|”), “;”, xdXDocument:GetDOM(“GetUserProfileByName”)/dfs:myFields/dfs:dataFields/s0:GetUserProfileByNameResponse/s0:GetUserProfileByNameResult/s0:PropertyData/s0:Values/s0:ValueData/s0:Value[../../../s0:Name = “Manager”])
you will get concatenated string of managers AD accounts. Applying same method to the resulting string again you will get managers emails. In between those 2 steps you will need to replace separator from “;” back to “|” with ‘translate’ function to make it work.
When you will have better understandiing of how does it work you will be able to fit everything in one rule.
alecpojidaev - January 5, 2009 at 3:31 pm |
Well written post. It’s nice to see more people using InfoPath’s built in functionality without resorting to code right away. :)
Richard Harbridge - February 26, 2009 at 4:35 pm |
Great post. It works perfectly for me. One question though, have you tried setting this up to work with two Contact Selectors on a form pulling in the profile information for two different users? I’m trying to get that to work but the second set of fields always pulls the first set of profile data.
If you have any ideas that would be awesome!
Mark - March 2, 2009 at 1:04 pm |
I had no problems with multiple Contact Selectors. Probably you need to reference the structure of 1st CS in the 2nd.
alecpojidaev - March 2, 2009 at 1:09 pm |
I have tried this solution and got it to work perfectly in my test environment. When I published it to the production server, though, everything went to hell. I have some users who even farm administrators cannot retrieve the email for, and other users who aren’t administrators can’t retrieve ANYONE’s email? I have searched for information on security and permissions for the userprofileservice.asmx, and can’t find anything about this at all.
The error message I get in all these instances is:
The query cannot be run for the following DataObject: GetUserProfileByName
InfoPath cannot run the specified query.
The SOAP response indicates that an error occurred:
A user with the account name DOMAIN\username could not be found. —> User Not Found: Could not load profile data from the database.
The production server is part of an enormous AD forest, with over 300K users, but I’ve found 2 users so far that nobody can retrieve a profile for, even though they’re members of the sharepoint site collection and have a profile.
Burtikus - March 11, 2009 at 2:40 pm |
It’s understandable why admins are having problems. It’s because they recognized as SystemAccount and there is no such record in AD or user profile database.
I dont know what causing your problem. Over all it doesn’t look like InfoPath specific problem. The only suggestion I have is to convert UserProfile connection and then navigate to Connection library and approve resulting *.udcx file.
alecpojidaev - March 11, 2009 at 3:00 pm |
Hi,
I’ve used this control and it works great. My challenge is that I need 2 of these controls in my form. I could achieve this by creating the “gpContactSelector” in a repeating group, but I don’t want the users to add more than 2. Is this possible? How?
Thanks!!!
-IA
Ivan - April 1, 2009 at 11:37 pm |
I dont think its reasonable to create repeating group for 2 repeating elements. If your second control is optional you could put it in a section and apply conditional formatting (hide/unhide) in responce of an user action.
alecpojidaev - April 2, 2009 at 1:24 am |
Hello Alec,
I guess I didn’t explain the situation very well. Basically, I need to have a Contact Selector for “Employee”, and one for “Manager”. An alternative would be to automatically pull the employee’s manager from AD (but have not explore that option yet).
So, for this I followed the instructions mentioned in the blog: http://blogs.msdn.com/infopath/archive/2007/02/28/using-the-contact-selector-control.aspx (see Oct 08, 2007), it says that you can have multiple Contact Selector fields by having a repeating group, but it does not limit the number these fields, and I only need 2. I tried to have another instance in my datasource but didn’t work because I must maintain the names of the fields, otherwise I believe it does not work.
Any guidance on resolving my needs (1 employee, 1 manager in separate fields) would be much appreciated.
Thanks!
-IA
Ivan - April 2, 2009 at 7:17 am |
Follow instructions in my blog but instead of “WorkEmail” use “Manager” it will give you manager data (managers login name).
alecpojidaev - April 2, 2009 at 1:15 pm |
I’ve tried this solution and it worked great while using it with infopath.
But I’ve some problems publishing the form to MOSS with office forms server. When I try to select a Person, the HlinktoEmail only shows the email of the user that is currently logged on to MOSS – not the one that I’ve selected in contact selector…
Can somebody please tell me what’s going wrong??
Thanks
Stefan
Stefan - April 9, 2009 at 9:39 am |
Never have expirienced that kind of problem before. It works fine in MOSS for me. Just make sure you moved all actions from Contact Selector to any other control.
alecpojidaev - April 9, 2009 at 1:13 pm |
I completed these steps, but I don’t get any different results with my people picker than before. I have my people picker on the form and immediately afterwards I placed the HlinkToEmail text box. Am I supposed to see the associated e-mail address in the text box? I need to be able to determine if the contact selected has an associated e-mail address (because our AD has some with and some without.
FYi, I’m not a programmer. I was successful in creating 2 separate people pickers on the same form, but now I need to insure there are related e-mail addresses attached to the user’s selections. I’m sure either I did something wrong, or I’m expecting something to happen that wont. The only difference I see is when I say set the HlinkToEmail field to a new value – because I’m already in that field, the rsulting formula only shows a “.” to indicate the field is the same. Thank you in advance. DAP
Donald - April 16, 2009 at 7:40 pm |
To: Donald
>Am I supposed to see the associated e-mail address in the text box?
Yes.
The “.” is supposed to be in the fields name. It means “self”. Then in the formula field you have to paste Xpath expression.
alecpojidaev - April 16, 2009 at 8:07 pm |
I pasted the Xpath expression in to begin with and then InfoPath reformats it somehow to what it likes. If I click the xPath check box the formula changes back and forth to the xPath formula and a simplified version InfoPath determines. Is there something else I can check? I went back and reviewed your instructions again and all seems well – just doesn’t give me an e-mail address. I deliberately pick a contact that has one listed, to ensure I get the desired results.
Donald - April 16, 2009 at 8:28 pm |
So what exactly you are getting in HLinktoEmail field after choosing a person?
alecpojidaev - April 16, 2009 at 8:49 pm |
I’m getting the same results as Stefan. I published the browser-enabled form to my MOSS site. When the form is displayed in InfoPath, HlinkToEmail shows the email addresses for the Person names entered. When the form is displayed via the form server, HlinkToEmail shows the logged on user. This is a simple form with just the Contact Selector and HlinkToEmail fields.
Mike - April 16, 2009 at 8:55 pm |
To Mike:
Have you moved all actions from Contact Selector to any other control?
alecpojidaev - April 16, 2009 at 9:01 pm |
No. Does it matter which control I move them to?
Mike - April 16, 2009 at 9:04 pm |
Any control will work (exept Contact Selector). The XPath will differ a bit:
xdMath:Eval(xdMath:Eval(../my:replyToControl/my:Person, ‘concat(my:AccountId, “|”)’), “..”)
alecpojidaev - April 16, 2009 at 9:09 pm |
I don’t get anything in the HlinkToEmail field. Not only that, but I can’t even click in the HlinkToEmail field to manually enter anything (not that I want to, I just find it odd – it acks like a read-only field). Keep in mind that I can also enter multiple contacts, even though I made the 3 sub fields non-repeating. I can send screen shots via e-mail if needed.
Donald - April 17, 2009 at 12:07 pm |
Everything looks correct. The only problem is your formula. Try to make it work with any repeating structure. There is alot of info on internet discribing in much better way than I did how to use double eval.
alecpojidaev - April 17, 2009 at 6:57 pm |
What is this double eval trying to do? I may be able to get it to work if I know what HlinkToEmail is expecting to receive to further process the data.
Donald - April 17, 2009 at 7:01 pm |
It should return concatenated string of AccointId’s in form of:
domain\user1|domain\user2 …domain\user10| .The last symbol should be “|”
alecpojidaev - April 17, 2009 at 7:05 pm |
Thanks for the great tutorial! I’m also having trouble when publishing my form as browser enabled (same as Mike and Stefen). I’ve even transfered the actions from the contact selector group to a field on my form. Do you mind posting additional details or tutorial on how you got it to work? Any help greatly appreciated!
Dennis - April 30, 2009 at 5:08 am |
To Dennis:
What exactly is your problem?
alecpojidaev - April 30, 2009 at 1:03 pm |
When I preview as an infopath form, the contact selector works as it should, pulling the email of the person selected. Once published to sharepoint (browser enabled), a person is searched and selected but grabs the email of the person using the form (different from the person selected). As suggested in one of the post, I’ve even transfered the rule and all the actions from the contact selector to a field on the form and still no luck. Any guidance, examples, or even additional screen shots is greatly appreciated. Thanks for your time.
Dennis - May 1, 2009 at 12:46 am |
To Dennis:
> I’ve even transfered the rule and all the actions from the
> contact selector to a field on the form and still no luck.
Please be specific. What do you mean when you saying “no luck”? What happened when you pressed/typed in control you’ve transferred actions to?
alecpojidaev - May 1, 2009 at 1:25 pm |
Side question – where is this ‘coding’ information documented?
For example, “xdMath:Eval(xdMath:Eval(my:Person, ‘concat(my:AccountId, “|”)’), “..”) ”
xdMath? Eval?
jake - May 28, 2009 at 6:54 pm |
Good question. I did a small research myself and, to my amusement, found nothing on Microsoft MSDN site (although there are few examples which uses that namespace).
If you will find more info please post it here. Looks like it’s a good reason to solicit Microsoft to fix that gap in documentation.
alecpojidaev - May 28, 2009 at 7:36 pm |
Thank you for this stuff, here was two issues I’ve search for a while and it helps a lot for my current bussines project.
It’s an amazing beautyful concept. I mean codeless programming by InfoPath.
Boris - June 10, 2009 at 6:50 am |
Has anyone successfully move all three rules to a control (like a button control) before?
I am trying right now and i can’t get pass the expression:
xdMath:Eval(xdMath:Eval(../my:gpContactSelector/my:Person, ‘ concat(my:AccountId, “|”)’), “..”)
Error said:
msxml5.dll
Reference to undeclared namespace prefix: ‘my’.
Error occurred during a call to property or method ‘Eval’.
Love to hear from the experts
dvn - June 26, 2009 at 5:04 pm |
xdMath:Eval(xdMath:Eval(my:replyToControl/my:Person, ‘concat(my:AccountId, “|”)’), “..”).
Your XPath is incorrect as for a button.
alecpojidaev - June 26, 2009 at 5:30 pm |
It seemed to run but my HlinkToEmail textbox return empty eventhough my selected 3 names in the contact selector.
Here is my setfCounter rule:
xdMath:Eval(xdMath:Eval(my:gpContactSelector/my:Person, ‘concat(my:AccountId, “|”)’), “..”)
Here is my fCounterRule:
concat(substring-after(., “|”), “;”, xdXDocument:GetDOM(“GetUserProfileByName”)/dfs:myFields/dfs:dataFields/s0:GetUserProfileByNameResponse/s0:GetUserProfileByNameResult/s0:PropertyData/s0:Values/s0:ValueData/s0:Value[../../../s0:Name = “WorkEmail”])
did you do something wrong?
dvn - June 26, 2009 at 6:29 pm |
one more time:
dvn - June 26, 2009 at 6:33 pm |
That won’t work.
The only action you need to move to the button is with eval function. The other rules has to stay where they are – at field control.
alecpojidaev - June 26, 2009 at 7:03 pm |
Well i left the frist rules there for the button and move the bottom two rules to the HlinkToEmail textbox field and the result still the same nothing on the textbox field when i click the button.
dvn - June 26, 2009 at 7:24 pm |
Make both rules on the field disabled to see if string of users properly populated by the button rule.
alecpojidaev - June 26, 2009 at 7:31 pm |
I took the 2 rules from the HlinkToEmail textbox field away and the result still empty. so there is something with my first rule.
Condition of the first rule set to:
Condition:
count(my:Person)>0
Actions
Set a field’s value: HLinkToEmail=xdMath:Eval(xdMath:Eval(my:gpContactSelector/my:Person, ‘concat(my:AccountId, “|”)’), “..”)
with Edit XPath (advanced) check box checked.
dvn - June 26, 2009 at 7:42 pm |
Check if anything is wrong with condition. Remove it from button rule.
alecpojidaev - June 26, 2009 at 8:01 pm |
I tried to debug through your example and i notice that i have twice the list of email addresses and when i trace back to the rule that use for the contact selector control i notice i got the list of AccountId listed twice and therefore the email address listed twice. I can’t seem to explained why?
Here is the rule used in my contact selector control:
eval(eval(Person, ‘concat(my:AccountId, “|”)’), “..”)
dvn - June 29, 2009 at 2:43 pm |
That means the event fires twice. But if you have moved all rules from contact selector to a button that kind of thing shouldn’t happened.
alecpojidaev - June 29, 2009 at 3:09 pm |
I could not get the button to work. I would like to clarify a few things:
As i understand there were total 3 rules mentioned in your example (setfCounter,fConterRule and RemoveChar) setfCounter rule used in the contact selector control and the other 2 rules used in the HLinkToEmail textbox. So i added a button and moved the setfCounter rule from the contact selector to the button. The other 2 rules stay with the HLinkToEmail textbox. Am i correct so far? When moving the setfCounter rule to the button i made the change according to some of your reply this past Friday as follow:
eval(eval(my:gpContactSelector/my:Person, ‘concat(my:AccountId, “|”)’), “..”)
That is where i am at. When i try to run it after selecting all names and click the button i got nothing in the textbox.
dvn - June 29, 2009 at 3:27 pm |
You getting nothing in textbox when rules on textbox desabled(unchecked) or with both rules checked?
alecpojidaev - June 29, 2009 at 4:01 pm |
I got nothing regardless whethere there are rules in textbox or not. I think the setfCounter rule doesn’t work. I am suspecting of the condition for the setfCounter rule. I could not get it to say:
Condition:
Number of occurrences of Person > 0
Here is mine:
Condition:
count(my:Person)>0
dvn - June 29, 2009 at 4:07 pm |
Ok. Just remove the condition then.
alecpojidaev - June 29, 2009 at 6:21 pm |
Finally i got it to work with condition applied. but the only problem i saw was that the some of the AcountId were not resolved to the approriate email.
Here is the list of accountId (which is correct)
MyCompay\dn978|MyCompay\mbs42|MyCompay\sag47|
Here is the list of email:
MyCompay\sag47|;DVNGUYEN@MyCompay.ORG;MSTOUT@MyCompay.ORG
As you can see, the last AccountId was not resolved and the warning/error was:
[IMG]http://i11.photobucket.com/albums/a189/nguyendd/error2.jpg[/IMG]
dvn - June 29, 2009 at 7:39 pm |
It should be configuration problem. It’s hard to say what it could be.
alecpojidaev - June 29, 2009 at 8:03 pm |
worked on Some AccountId’s and did not work on some others. Do you have any tips as where to look this kind of configuration problem? This blog is great and i learned so much.
dvn - June 29, 2009 at 8:08 pm |
Log as user you having problems with and call GetUserByName method. See what you get.
Sharepoint admins having problems with thier emails quite often too.
alecpojidaev - June 29, 2009 at 9:07 pm |
Hi Alec, Got one problem, when performing the step xdMath:Eval(xdMath:Eval(my:Person, ‘concat(my:AccountId, “|”)’), “..”) , it gives an error with the formular. I’m very new to this so prob missing something small. Any advice? Bellow is a copy of the error.
Unexpected character.
xdMath:Eval(xdMath:Eval(my:Person, –>‘<–concat(my:AccountId, "|")’), "..")
Thanks
Jon - July 1, 2009 at 8:48 am |
That’s really simple. That symbol you having trouble with designated to indicate single quot. However the symbol itself is not a single quot. So just delete it and replace with real single quot symbol.
alecpojidaev - July 1, 2009 at 1:20 pm |
THANKS!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Thought it was something simple……….
Jon - July 2, 2009 at 1:47 pm
Yes you were correct and i have found that to be the problem as well. One side affect that i have seen was that eventhough if i did not enter any name in the contact selector control the HLinkToEmail still list one email address which is email address of the person with the current logged-in account id. I looks like the condition for the contact selector rule: Number of occurences Person >0 did not execute correctly.
I was trying to create a template part for this contact selector control since i am using quite often in my forms but it seem that it is not doable since the control is always disabled in the template part design mode. Do you know if it is posible to that? i can’t seem to be able to add the control to a template part.
dvn - July 1, 2009 at 1:49 pm |
Well.. I never used templates parts so I can’t help you here. I would be interested in final results of your attempts though. Please post here if you were succeseful.
alecpojidaev - July 1, 2009 at 1:55 pm |
Thats how it should be. Initially group always have one node so check will be always be true unless you will delete that initial node manually. The condition serves to prevent to fire the event wich will errors out without that condition.
alecpojidaev - July 1, 2009 at 9:33 pm |
One side affect that i have seen was that eventhough if i did not enter any name in the contact selector control the HLinkToEmail still list one email address which is email address of the person with the current logged-in account id. I looks like the condition for the contact selector rule: Number of occurences Person >0 did not execute correctly.
Have you seen it?
dvn - July 1, 2009 at 1:57 pm |
I’m getting the same results…. no matter how many people I select in the contact selector I get one email resolved, the email of the current user.
Zeb - July 8, 2009 at 8:06 pm |
Have you moved the rules from Contact Selector to the different control?
alecpojidaev - July 8, 2009 at 8:29 pm
i have seen the same issue and when i moved the rule from contact selector to a button it worked.
dvn - July 8, 2009 at 8:31 pm |
And the condition of this rule should say:
Number of occurences of Person > 0
dvn - July 8, 2009 at 8:33 pm |
By the way, can this control be adaptive to different situation? I have a need to allow the user to select multiple item in the dropdown list box in my form, since multiple selection list box is not supported in browser-enabled, can i adapt this contact selector for that situation? if not is there a work around with my situation? thank you in advance
dvn - July 15, 2009 at 12:10 pm |
The workaround is not that complex. Use repeating section/table with checkboxes-values pairs and then apply double eval trick same as in this article to get string of values where checkboxes are checked separated with a separator of your choice
alecpojidaev - July 15, 2009 at 3:41 pm |
Hi.
Great post and implemented. However I in browser I am getting the same issue as Dennis. You said
“Note: There is a problem with browserenabled forms. Rules at Contact Selector provide totally unpredictable results. So to make it work I’ve moved all Contact Selector rules to a simple button.”
How do I move these to a simple button please.
Gareth H - August 13, 2009 at 11:05 am |
Read hole discussion with DVN it covers in details what should be done.
alecpojidaev - August 13, 2009 at 1:22 pm |
Hi
Thanks for the help I still get
msxml5.dll
Reference to undeclared namespace prefix: ‘my’.
Error occurred during a call to property or method ‘Eval’.
This is the rule
xdMath:Eval(xdMath:Eval(my:replyToControl/my:Person, ‘concat(my:AccountId, “|”)’), “..”)
Gareth H - August 13, 2009 at 2:33 pm |
Try to delete “my:replyToControl/my:Person” part in the XPath formula and pick the Person group using field picker.
alecpojidaev - August 13, 2009 at 3:01 pm |
Wow thanks for this solution! I have tried and tried and finally I found this. But when you give the NOTE at the end for browser-enabled forms, and you say : “So to make it work I’ve moved all Contact Selector rules to a simple button.”…..
what do you mean by moving all rules to a button? Can you show me how to do this?
Thanks!
Melissa - September 3, 2009 at 7:31 pm |
Edit: actually I desided to excude all parts of description that doesn’t work in browser. Check out XPath/layout changes.
The action with this rule:
xdMath:Eval(xdMath:Eval(my:Person, ‘concat(my:AccountId, “|”)’), “..”)
should be moved to any other control. The final XPath will be different depending on what control the formula and it’s condition (count(./my:Person)>0) will be moved (i.e. the relative XPath at a field to the my:Person group differs from XPath at a button because buttons are closer to the root)
alecpojidaev - September 3, 2009 at 8:18 pm |
Hi Alec, great post! I’ve read through all the conversations and I am also getting the:
msxml5.dll
Reference to undeclared namespace prefix: ‘my’.
Error occurred during a call to property or method ‘Eval’.
error. I am using a button. I have the count-person condition and the eval rule on this button. Any ideas?
MAV - September 9, 2009 at 9:36 pm |
Make sure you have latest version of XPath formula. I recently updated formulas to be compatible with Form Sevices.
alecpojidaev - September 10, 2009 at 1:05 pm |
Yep I have the latest xpath formula:
xdMath:Eval(xdMath:Eval(my:Person, ‘concat(my:AccountId, “|”)’), “..”)
I have more than one contact selectors so I also tried:
xdMath:Eval(xdMath:Eval(../my:A12participants/my:A12participant1/my:Person, ‘concat(my:AccountId, “|”)’), “..”)
Still no luck. Here is part of my data source structure:
-A12participants
-A12Participant1
-Person
DisplayName
AccountID
AccountType
Any ideas?
MAV - September 10, 2009 at 2:38 pm |
You have to remove leading ../
Also in AccountId “d” is lowcase. It’s important(both field and formula).
alecpojidaev - September 10, 2009 at 3:07 pm |
The cap “D” was my mistake when replying to you. It is actually lowerces in the form. I tried taking the “../” out and I also tried “./”. I also tried choosing it from the field picker. No dice. Anything else I should do?
MAV - September 10, 2009 at 3:33 pm |
Is any of your upper group levels for the Person group are repeating ones?
alecpojidaev - September 10, 2009 at 3:54 pm |
No. A12participants and A12Participant1 are not repeating groups. Does it matter how I setup the other contact selectors?
MAV - September 10, 2009 at 6:44 pm |
It’s hard to say what is wrong in your case. I could look into the code of the stripped version of your form if you OK to share it somewhere.
alecpojidaev - September 10, 2009 at 7:06 pm |
Hi Alec,
I have used this formula to obtain a list of email from a repeating table:
eval(eval(GrpTechDept; ‘concat(my:TechEmail, “;”)’); “..”)
I got a resulting list like this:
“email1@blabla.com;email2@blabla.com;email1@blabla.com”
Now I would like to remove the duplicate email from this list. Is there a trick to improve the formula above to prevent concatenating duplicate value (codeless of course).
Thank you in advance. Kind regards,
Thanh-Nu
Thanh-Nu Leroy - September 17, 2009 at 2:25 pm |
Sorry I don’t know how to do that. In my enviroment i don’t care about duplicates. At least Exchange2007 is smart enouth to not send email twice.
alecpojidaev - September 17, 2009 at 2:51 pm |
As I am attempting to set the rule in the button, InfoPath 2007 says there is an incorrect character in your expression:
xdMath:Eval(xdMath:Eval(my:Person, ‘concat(my:AccountId, “|”)’), “..”)
It points to the ‘ before concat but if I remove it there are more errors
Sorry to be a bother on this, but it is not very intuitive
Scott - December 17, 2009 at 9:25 pm |
you have to replace single quote with actual sign. The copied string has sign used in HTML pages and it’s not a single quot it’s just looks similar.
Edit: I’ve replaced wrong quotes right in the post.
alecpojidaev - December 17, 2009 at 9:33 pm |
First, thank you for posting this solution, incredibly helpful. :)
It seems that my form is not iterating through the list of contacts I select in the Contact Selector. I cannot figure out why. Has anyone else had issues with this? The text that generates is just the first contact’s information repeated for each contact I selected.
I.E. I select: Doe, John; Jane, Smith; Bob, Brown
Text generated: John.Doe@email.com; John.Doe@email.com; John.Doe@email.com
Please let me know if you have any thoughts, thank you!
CJL - December 17, 2009 at 10:28 pm |
Check what account name you are supplying to the websevice.
alecpojidaev - December 18, 2009 at 2:12 pm |
Sorry, I’m new to using InfoPath, how would I check that?
If you mean the AccountName=substring-before part, the AccountName is supplied from GetUserProfileByName data source, under the myFields, queryFields, s0:GetUserProfileByName.
I seem to have issues before the part that converts the AccountIDs to email addresses. If I remove all of the rules assigned to the HlinkToEmail field and only keep the rules attached to the button, the text box returns something like: ACUS\E10091|ACUS\E10091|ACUS\E10091
So it seems to recognize that there are three contacts I’m trying to pull, but it only retrieves the AccountID of the first contact? Any thought?
Thank you!
CJL - December 18, 2009 at 5:59 pm
If ACUS\E10091|ACUS\E10091|ACUS\E10091 is the string returned by double eval formula where all accounts are the same that means there is an error in your version of this formula: xdMath:Eval(xdMath:Eval(my:Person, ‘concat(my:AccountId, “|”)’), “..”).
alecpojidaev - December 18, 2009 at 7:11 pm
This is my formula:
xdMath:Eval(xdMath:Eval(/my:myFields/my:gpCopyToContacts/my:Person, ‘concat(/my:myFields/my:gpCopyToContacts/my:Person/my:AccountId, “|”)’), “..”)
Where gpCopyToContacts is my Contact Selector. Rather messy, I know. As far as I can tell, it seems to replicate your formula, just with different XPaths for my Contact Selector. Am I referencing my:Person and my:AccountId incorrectly?
CJL - December 21, 2009 at 2:47 pm
That part: (/my:myFields/my:gpCopyToContacts/my:Person/my:AccountId is incorrect.
The path to the field has to be relative not absolute.It should be much shorter: (my:AccountId
alecpojidaev - December 21, 2009 at 2:54 pm
Excellent! That was it! Thank you so much!
CJL - December 21, 2009 at 3:34 pm
msxml5.dll reports undeclared prefix ‘my’ when I try to assign the Text field the value of xdMath:Eval(xdMath:Eval(my:Person, ‘concat(my:AccountId, “|”)’), “..”)
Alexey - January 12, 2010 at 9:25 am |
Use absolute path to the Person group. Your path looks too short.
alecpojidaev - January 12, 2010 at 2:13 pm |
Thanks for sharing us your solution, i’m very greatful :) (F)
Qassem - March 28, 2010 at 12:04 pm |
Can this be modified to work on a repeating field?
Great tool for repeating groups, but in my situation I’m using a multiple selection list box because I’m displaying from a list and want the users to be able to just check the names to be contacted.
Lorraine - May 14, 2010 at 4:10 pm |
Yes, it can be modified that way. Just google
infopath “double eval”
alecpojidaev - May 14, 2010 at 4:50 pm |
Hi Alec,
I’m just writing to say thanks for taking the time and putting this together. It works like a charm and is very helpful.
Although it works, I’m curious to know how/why it works so that I understand it better. My understanding is the following string is set as the value of the “AccountName” field of the GetUserProfileByName data source.
substring-before(., “|”)
After running the query, the webservice returns necessary information. Now, to me, that looks like getting the very first username returned by the contact selector tool. Where does the actual iteration take place? I’m not clear on how the rule is looping through all the username and then query the data source.
Thanks,
pl7626 - July 12, 2010 at 12:35 am |
To pl7626:
The iteration is happening when the HlinkToEmail gets a new value. What actually formula at HlinkToEmail field does is it removes the user before “|” and adds the removed user’s email to the end of the string. Thats triggers the next iteration. Thus each iteration removes one “|” delimeter per cycle. As you can see to prevent infinite loop the condition is checking for existence of “|” separator.
alecpojidaev - July 12, 2010 at 2:52 pm |
Hi Alec,
Thanks for replying on this. Now that you explained this, it looks so simple. I should’ve paid more attention to the formula that sets value on the HlinkToEmail field :)
It’s a really nice trick and opens a whole new door to iterating through repeating stuff using just rules.
Thanks again. It’ll be really useful.
pl7626 - July 12, 2010 at 11:42 pm
Hello! I went thru the proceedures listed. Unfortuantely, I can not figue out how to hook up all of this to my 3 Person Group Picker fields. I am usnig InfoPath 2010. My purpose is to set up a rule so when a user clicks on my custom submit button on the form, the emails get sent to the choosen individuals. As you know, by default the fields populate with Kreuder, William and the system does not recognize this as an email. Thanks!
William Kreuder - July 16, 2010 at 4:58 pm |
Well… the whole article is about how to do that. Sorry, I don’t know how to describe it in better way.
alecpojidaev - July 16, 2010 at 5:20 pm |
My situation is quite simpler (no contact selector control) but i can’t get it to give me the list of comma seperated email addresses from the sharepoint server list. Here is what i have done:
1. Adding a new “data connection to receive data from SharePoint library or List” where i selected Email Address column of the contact list.
2. I added a new Text Field and define a new rule with “Query using a data connection” defined above.
3. I defined a rule in my Text field with two actions like these:
Query using a data connection:GetEmailAddress
=fx Set a field value:.=concat(.,”,”,@EmailAddress)
What am i doing wrong? Thank you in advance. Really can use the help to get it to work since I am pressure for time
David N. - August 17, 2010 at 7:44 pm |
You still need to use double eval construction. Simple concat won’t work.
alecpojidaev - August 17, 2010 at 8:12 pm |
how would you formulate the double eval? can you help?
David N. - August 17, 2010 at 8:24 pm |
There is formula in the blog.
alecpojidaev - August 17, 2010 at 8:28 pm |
i put this code concat(@EmailAddress, “,”) in the value of the Text box then i got the first emailaddress (which id ok) but if i want to use the double eval for repeating group (see below) then i got an error saying: Infopath cannot open the selected form. Obviously there is some thing wrong my double eval statement but i can’t seem to see it.
my double eval:
eval(eval(RoeDataEntryNotifiers, ‘concat(xdXDocument:GetDOM(“GetDefaultReceivers”)/dfs:myFields/dfs:dataFields/dfs:RoeDataEntryNotifiers/@EmailAddress, “,”)’), “..”)
where RoeDataEntryNotifiers is a repeating group for my data connection which query the list of sharepoint server.
David N. - August 19, 2010 at 2:41 pm |
The formula should be shorter:
eval(eval(RoeDataEntryNotifiers, ‘concat(@EmailAddress, “,”)’), “..”)
alecpojidaev - August 19, 2010 at 2:47 pm |
And if i put the double eval in the rule section of the text box then the form displayed but i got nothing in the textbox field.
my double eval:
eval(eval(RoeDataEntryNotifiers, ‘concat(xdXDocument:GetDOM(“GetDefaultReceivers”)/dfs:myFields/dfs:dataFields/dfs:RoeDataEntryNotifiers/@EmailAddress, “,”)’), “..”)
David N. - August 19, 2010 at 2:46 pm |
Try this, this works for me.
You don’t need any rules, just paste it into the value field inside the properties section of your text box.
eval(eval(Person, ‘concat(substring-after(my:AccountId, “\”), “; “)’), “..”)
Select fx then highlight Person, insert field or group and select person from under the contact selector that you are using.
This should work for you too.
Akosua - September 1, 2010 at 12:55 am |
It worked. Thank you very much.
David N. - August 19, 2010 at 2:53 pm |
This stuff is really helpful. Thanks! However, I am putting up a new form where I can use the same technique discussed here but with a twist… I’m not using contact selector and if there are identical email addresses, only one should be added to the HlinkToEmail field.
Hope to hear from you soon.
Thanks!
Jett - September 24, 2010 at 2:02 pm |
The duplicated address never been a problem because all modern mail servers are able to recognize duplicates and trim them. So people never will recieve duplicates of the same email. If you still need to address that isssue you could use validation rule based on technique described here to validate user input.
alecpojidaev - September 24, 2010 at 2:31 pm |
I appreciate the quick response. If duplicates get automatically trimmed then I guess I don’t have to worry about it then. Thanks again!
Jett - September 24, 2010 at 5:52 pm
Hello Alec,
Could you please help me with my problem? I am using this to set a text field when a button is clicked. I am using Person/Group picker – multiple select enabled (InfoPath 2010).
eval(eval(Person, ‘concat(/my:myFields/my:PointOfContacts/pc:Person/pc:AccountId, “|”)’), “..”)
First of all, I am not sure why the prefix is “pc” and not “my”.
Second this is that when I click the button to populate the text field, I get the AccountId of the first user repeated so many times (depending on how many users I have in the Person/Group picker control).
Michael - October 21, 2010 at 2:27 pm |
Try
eval(eval(Person, ‘concat(pc:AccountId, “|”)’), “..”)
alecpojidaev - October 21, 2010 at 2:45 pm |
Worked great! Many thanks!
Michael - October 21, 2010 at 3:00 pm
I’m trying to design a form where users can optionally CC a copy of the form to someone else (the default destination is the same for everyone). I’ve gone through and set everything up the way you explained, and didn’t get any errors, and set HlinkToEmail as the cc address in my submission data connection.
Problem is, nothing happens. Put HlinkToEmail onto the form as a text box, and disabled all the other rules on the Submit button, but nothing happens. If I create a rule that says ‘Change the value of HlinkToEmail to: “Yarg!”‘, then when I click the button, “Yarg!” appears in the HlinkToEmail box. But with the rules I created from this article, nothing ever appears in the box.
I’m not terribly familiar with InfoPath, so I don’t know if I’m just being unusually dense, or if there a step somewhere I’m missing. Any help would be much appreciated.
TimMc - December 4, 2010 at 1:19 am |
You shouldn’t put that functionality on the submit button. The best way to design this form is to use default value of HlinkToEmail, not rule at the button. Assign this formula from the post as HlinkToEmail default value:
xdMath:Eval(xdMath:Eval(my:Person, ‘concat(my:AccountId, “|”)’), “..”)
At the time when you’ll need to submit the form the emails will be ready.
alecpojidaev - December 4, 2010 at 4:22 pm |
Is it possible to download the soultion file?
mrspikula - February 23, 2011 at 10:00 pm |
No. There is no IP form to download. Working form require connection to the webservice wich would be different in every organization.
alecpojidaev - February 24, 2011 at 2:52 pm |
Like Michael i`m having a problem with the Eval pointing to a Person field. In my case i tried to use the formula as alecpojidaev says: eval(eval(Person; ‘concat(pc:AccountId, “|”)’); “..”) but in my case i got a error that says: “Reference to undeclared namespace prefix: ‘pc’.Error occurred during a call to property or method ‘Eval’. “. I should also state that my Person group is inside a sharepoint list that a i use as a secondary data source.
Thanks in advance
Adriano Coura - February 24, 2011 at 9:20 pm |
It depends on InfoPath version. You should probably use prefix “my” instead of “pc”
alecpojidaev - February 25, 2011 at 7:32 pm |
Great Post!
It works fine for me when I send the email fro the first time. However, when I reopen the form and attempt to send the email again after making fre updated I am getting an error. The HToEMailLink is storing someother value instead of the email address.
Could you please help me to resolve this?
Thanks,
Devya
Devya - April 26, 2011 at 6:25 pm |
What I can say? Don’t change the value and it will stay unchanged.
alecpojidaev - April 26, 2011 at 6:41 pm |
Hi ,
Thank you for the great article on using-the-contact-selector-control. I was able to implement it successfully but now I want to add multiple contact selector in the same form. I did add the reference of the contact selector created and tried setting the HlinkToEmail but it sets the value to DOMAINNAME\login name and gives following error:
————————————————–
The query cannot be run for the following DataObject: GetUserProfileByName
InfoPath cannot run the specified query.
The SOAP response indicates that an error occurred:
A user with the account name true could not be found. —> User Not Found: Could not load profile data from the database.
———————————————————
sudhesh Dessai - April 27, 2011 at 2:32 pm |
You requesting the profile info of the user with name “true”. Do you have this user in your organization?
alecpojidaev - April 27, 2011 at 3:07 pm |
Thanks for the reply. Yes the employee is in to organization and I am able to pull the details in the fisrt contact selector but the secound contact selector throws an error.
I created a group and then added the reference of the fisrt contact selector and replicated the same steps in the article.
When is lookup it shows the employee and get the domain and login id in textbox.
Not able to figure out where it is gng wrong because it works for the 1st contact selector. Need help!!
Also can you suggest some good books to buy for infopath 2007 programing and sharepoint workflow programing.
sudhesh Dessai - April 27, 2011 at 3:28 pm
Is “true” the last name or the first name of your user?
alecpojidaev - April 27, 2011 at 3:44 pm
No.
But Alec, I am able to lookup the same employee in the 1st contact selector but not in the 2nd selector. It just gives the domain\login name as output in the text box with error.
I even tried selecting different employee and its the same error.
Please help!!!
sudhesh Dessai - April 27, 2011 at 3:53 pm |
No?
The error message clearly indicates that you submitting the string “true” to the service instead of valid username.
alecpojidaev - April 27, 2011 at 3:59 pm |
I am new to InfoPath programing and I dont know from where it is pulling up the account name “true” though the output in the textbox is domain\login id. Does it use this output to search the the work email?
The 1st contact selector is working fine with no errors.So I think I am messing arround in creating/configuring the 2nd contact selector.
I followed the following steps in creating the 2nd contact selector:
Ref:http://blogs.msdn.com/b/uksharepoint/archive/2009/04/29/using-multiple-contact-selector-controls-in-a-single-infopath-form.aspx
1. Created group filed.
2. Added the contact selector control
3.Then added the reference of the first contact selector to group field
4. Bind the newly added contact selector to referenced ontact selector
4. Then followed the above article.
Please let me know where exactly i am going wrong or how can we have multiple contact selector controls in the same form.
Sudhesh Dessai - April 27, 2011 at 7:13 pm
Hi Alec,
Hey , its working for me now :) . Its was just typo error in the rule which sets the AccountName. Thank you for this great post! You made my work lot easier!
Can you suggest some good refrence book for Infopath programing and also sharepoint for beginners.
Once again thanks for this gr8 article!
sudhesh Dessai - April 28, 2011 at 4:53 am |
Sorry, I cannot recommend any good book. I learned both InfoPath and Sharepoint using Google query string.
alecpojidaev - April 28, 2011 at 1:51 pm |
Dats fine Alec,
I have an issue with the control when the form is displayed in web browser(pulishing it to open in browser)
Its does not populate the HlinkToEmail with the search account name but it sets the HlinkToEmail to email id of the user logged in twice.
example:
For the 1st serach Click in contact selector
HlinkToEmail= abc@myorg.com
For 2nd Account Search
HlinkToEmail=abc@myorg.com;abc@myorg.com.
Do we need to change the rules to use contact selector for browser enabled IP form?
The above rules work fine when we open it in InfoPath Client.
Please Help!
sudhesh Dessai - April 29, 2011 at 12:11 pm
No changes required for browser enabled forms. Such behaivior like in your situation is common when you submitting the empty string to the service.
alecpojidaev - April 29, 2011 at 2:27 pm
But Alec, I tried opening the pubilshed form in the client instead of Browser and It works fine.
And If I change the settings of the form Library to open the form to browser again the output is duplicate ids though it searches for the right User and displays the name in the Contact Selector but the textbox takes the email id based windows logon for 1st search, and then second time we lookup it appends the serached email id and the old value in the text box.
And on third try it gives the following o/p:
Contact Slector values : Abc,Smith;xyz,Test
Textbox value: acb.smith@myorg.com;xyz.Test@myorg.com;acb.smith@myorg.com;xyz.Test@myorg.com
So how is it possible for the contact selector to assign blank value to AccountName when we have name displayed in the Contact Selector?
I am trying to debug the rules….but no luck so far….
It is working fine when we open it InfoPath Client from the library.
Please reply!
sudhesh Dessai - April 29, 2011 at 2:56 pm |
How you assigning the initial value to the HLinktoemail field by rule or as default value?
alecpojidaev - April 29, 2011 at 5:18 pm |
Using the below rule:
setfCounter.
count(my:Person)>0
xdMath:Eval(xdMath:Eval(my:Person, ‘concat(my:AccountId, “|”)’), “..”)
and the above rule is set on the myContactSelector group filed which is binded to contact selector:
i.e:
myContactSelector
>Person
>>DisplayName
>>AccountId
>>AccountName
Sudhesh Dessai - April 30, 2011 at 6:46 pm
Alec , I have still not found the solution for it! I am trying to check output of each actions in the rules…no breakthrough as of now :(..Please help!
sudhesh Dessai - May 3, 2011 at 5:50 am
This was a great post. The only question I have is when the form is re-opened the HlinkToEmail field is showing as the Domain/Username. How can I avoid this from occurring? I would still like the email address to be presnt.
Thomas - June 10, 2011 at 8:06 pm |
You are the first who is experiencing such problem. That makes me think that values are changed by external process like workflow or other rules.
alecpojidaev - June 13, 2011 at 1:26 pm |
I have this being set as the default value in the HlinkToEmail field.
xdMath:Eval(xdMath:Eval(../my:ControlSelector/my:Person, ‘concat(my:AccountId, “|”)’), “..”)
Does that look correct?
Whenever I choose a value from the control selector the email is being populated in the HLinkToEmail field, but as soon as I save a re-open the form the HLinkToEmail fiedl now has Domain/Username. I think it has to deal with the default value.
Thomas - June 15, 2011 at 1:05 pm
Hello,
Its agreat tutorial. But I get the following error when I try to set the defau value of the text box. The formula I am using is
xdMath:Eval(xdMath:Eval../my:group7/my:group8/my:group_3/pc:Person,’concat(../my:group7/my:group8/my:group_3/pc:Person/pc:AccountId, “;”)’), “..”)
Error:
msxml6.dll
Reference to undeclared namespace prefix: ‘pc’.
Error occurred during a call to property or method ‘Eval’.
Do you think I am missing something. Also want to ask what is the data source “Context(secondary)” mentioned in the article(which a picture)?
Suma - July 19, 2011 at 6:28 pm |
xdMath:Eval(xdMath:Eval../my:group7/my:group8/my:group_3/pc:Person,’concat(../my:group7/my:group8/my:group_3/pc:Person/pc:AccountId, “;”)’), “..”)
Left parentesis is missing after second Eval. The field addres is incorrect too. Shoud be:
’concat(pc:AccountId, “;”)
alecpojidaev - July 19, 2011 at 8:18 pm |
The eval method helped me out really….Thanks
Kivuos - August 16, 2011 at 8:31 am |
By default it displays the email ID of the current user in the field (when the rules SetfConter and RemoveChar is added to text field instead of button)
Please let me know how to get rid of this value when form is loaded
Alan - August 18, 2011 at 3:48 am |
You need to uncheck checkbox in setting of your UserProfile service connection that is responsible for initial retrieving of data.
alecpojidaev - August 19, 2011 at 12:35 am |
Hello,
I’m eager to get this working. This is awesome information. Has anyone else had this error?
“xdXDocument:GetDOM(“GetUserProfileByName”)/dfs:myFields/dfs:dataFields/s0:GetUserProfileByNameResponse/s0:GetUserProfileByNameResult/s0:PropertyData/s0:Name” does not point to a valid location path of a field or group.
What can I do to get rid of this error?
Thanks,
Karen
Karen - September 21, 2011 at 5:10 pm |
Select the whole path and use the UI to navigate to Name field in the secondary datasource. Do replace.
alecpojidaev - September 22, 2011 at 2:34 pm |
Hey man,
Inspiring stuff. If I can get over the minor hurdle I have fo rhtis, I will be able to kill two birds with your stone here.
Not modifying anything, when I use (turned edit xpath on):
xdMath:Eval(xdMath:Eval(../../my:InitialView/my:NotifyList_IV/pc:Person, ‘concat(../../my:InitialView/my:NotifyList_IV/pc:Person/pc:AccountId, “|”)’), “..”)
I get as an error:
“../../my:InitialView/my:InitialView/my:NotifyList_IV/pc:Person/pc:AccountId” does not point to a valid location path of a field or group.
I’ve shifted to using my:AccountID, using the Insert Field to insert the AccountID field, I’ve even used a completely different field unrelated to this task just to test it out, and I keep getting this error.
Any ideas?
Travis - September 27, 2011 at 5:29 pm |
Please read coments above. There were already 5 or 6 people with the same error. The path inside your concat function is incorrect.
alecpojidaev - September 28, 2011 at 8:19 pm |
I still can’t figure this out. Here’s what I have
for the button
xdMath:Eval(xdMath:Eval(my:gpContactSelector/my:Person, ‘concat(my:gpContactSelector/my:Person/my:AccountId, “|”)’), “..”)
error:
“my:gpContactSelector/my:Person/my:gpContactSelector/my:Person/my:AccountId” does not point to a valid location path of a field or group.
chris - October 19, 2011 at 8:24 pm |
Try to read comments above. This problem have appeared here for at least 5 times.
alecpojidaev - October 19, 2011 at 9:58 pm |
Hi Alex,
I have a set of names divided by semicolons
John Doe; Jane Winn
that I know I can add to a contact control to show up there as long as I add the correct XML:
John DoeJane Winn</my:gpTeam
How can I do that with browser form xpath?
Thanks,
Sara
Sara Tenenbaum - November 7, 2011 at 8:03 pm |
I’m not sure what you trying to do.
alecpojidaev - November 7, 2011 at 9:28 pm |
I have a form setup where I can add multpile people to the contact selector. I have the steps in this forum, but when I click the button to display the email addresses, it only show the first person name that I enter. How do I fix this?
Ronnie - February 1, 2012 at 4:44 pm |
The only way to fix it I’m aware of is to double check each element in your form following this tutorial.
alecpojidaev - February 1, 2012 at 5:13 pm |
Nevermind. I was able to find the solution using CJL conversation with you. I was using an absolute path instead of relative path.
Thanks.
Ronnie - February 1, 2012 at 5:29 pm |
I have followed all the steps with the contact selector and the context. but when i clicked the To button and search for a name i get search failed. any idea from where i can solve this.
Adrian - February 27, 2012 at 8:10 am |
Contact selector steps are different in SP2007 and SP2010
alecpojidaev - February 27, 2012 at 1:53 pm |
i know that they are different. i am using infopath 2007 and it is working with the test server but not with the production server
Adrian - February 27, 2012 at 2:02 pm
I have a solution to the missing namespace:
http://www.mattjimison.com/blog/2012/03/08/infopath-reference-to-undeclared-namespace-prefix-pc/
Matt - March 9, 2012 at 4:04 am |
This worked perfectly in my sharepoint 2010 and infopath 2010 implementation. Do you have a suggestion on how I can submit the form to the email address calculated via HLinktoEmail?
ana - March 16, 2012 at 12:45 am |
Have you heard about InfoPath email submit?
alecpojidaev - March 16, 2012 at 2:54 pm |
Yes, that is where I’m stuck. I want to cc the email to the email address that is calculated from the people picker field. I’m just stuck on which field to reference or if I need to add an additional rule or field.
ana - March 16, 2012 at 3:01 pm
You need to reference HLinktoEmail field.
alecpojidaev - March 16, 2012 at 6:31 pm
I tried that but it doesn’t work.
ana - March 19, 2012 at 11:39 am |
This solution is not working for me in SharePoint Claims authentication I think becuase of the AccountId format.
Also the Action rules on person (repeating control) in Infopath 2010 does not show up in Manage rules but displays it in Rule Inspector with “error in processing”.
xdMath:Eval(xdMath:Eval(my:Person, ‘concat(my:AccountId, “|”)’), “..”)
I am able to get only first user email id by changing the below rules:
fCounterRule:
contains(., “i:0#.w|”)
substring-before(substring-after(., “i:0#.w|”),”|”)
Please help!
/Sudhesh
Sudhesh Dessai - November 18, 2013 at 11:51 am |