<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Newbie Questions</title><link>https://www.infopathdev.com:443/forums/39.aspx</link><description>New to InfoPath? Search to see if your question has already been answered. If it has not, then ask it here or the appropriate topic forum.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Using infopath formula with filters and returning multiple results</title><link>https://www.infopathdev.com:443/forums/thread/34812.aspx</link><pubDate>Mon, 24 Nov 2008 16:27:40 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:34812</guid><dc:creator>h.elshabini</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/34812.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=34812</wfw:commentRss><description>&lt;p&gt;thnx jimmy, i tried what u told me and it worked however i cannot do this to every single section in the form, its pretty big.&lt;/p&gt;
&lt;p&gt;well i did a work around by putting in the xml document (datasource) enough info inorder for it to return to me the most appropriate user role after a ton of filtering :S and then im gonna do actions for this user depending on this only role i got back from the xml document.&lt;/p&gt;
&lt;p&gt;well thnx for helping me but it seems there is no way to simply populate a field with multiple values automatically, unless it&amp;#39;s in the interface...thnx alot...&lt;/p&gt;</description></item><item><title>Re: Using infopath formula with filters and returning multiple results</title><link>https://www.infopathdev.com:443/forums/thread/34810.aspx</link><pubDate>Mon, 24 Nov 2008 15:45:47 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:34810</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/34810.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=34810</wfw:commentRss><description>&lt;p&gt;XPath can be very useful, and not too confusing once you get the hang of it.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Anyway, if you want to hide a section when a user is not in a certain role, you should be able to use XPath like the following in the conditional formatting dialog:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;not(xdXDocument:GetDOM(&amp;quot;roles&amp;quot;)/roles/role[name = &amp;quot;Account Manager&amp;quot;]/users/username[. = userName()])&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;You would replace the &amp;quot;roles&amp;quot; in quotation marks with the name of the secondary data source, and &amp;quot;Account Manager&amp;quot; with the appropriate role name.&amp;nbsp; You can use AND and OR, or remove the enclosing not() to create more complex logic.&lt;/p&gt;</description></item><item><title>Re: Using infopath formula with filters and returning multiple results</title><link>https://www.infopathdev.com:443/forums/thread/34809.aspx</link><pubDate>Mon, 24 Nov 2008 15:23:23 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:34809</guid><dc:creator>h.elshabini</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/34809.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=34809</wfw:commentRss><description>&lt;p&gt;yes i am familiar with code, c# especially, but this whole XPath mess just pisses me off and i did not want to get messy untill im sure that there is no way to do that out of the box.&lt;/p&gt;
&lt;p&gt;anyway, about this field, i play to keep the role names which the current user can play in this document, and depending on it user may or maynot have restrictions in the form.&lt;/p&gt;
&lt;p&gt;like im gonna use it for conditional formatting and things like that, to acheive some security restrictions.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;the only problem is that a user might have multiple roles, this is where the problem emerged. so i need to have the roles that he can play check them if they contain or not a certain string every now and then.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;any help?&lt;/p&gt;</description></item><item><title>Re: Using infopath formula with filters and returning multiple results</title><link>https://www.infopathdev.com:443/forums/thread/34808.aspx</link><pubDate>Mon, 24 Nov 2008 15:03:05 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:34808</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/34808.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=34808</wfw:commentRss><description>&lt;p&gt;I don&amp;#39;t believe the default value on a field can populate a repeating field like that, and this doesn&amp;#39;t sound like something that can be done with rules either.&amp;nbsp; It wouldn&amp;#39;t be too difficult to do with code, but are you comfortable with code?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;But may I first ask what you plan to do with the field once it is copied over?&amp;nbsp; Depending on that answer you may be able to use the data in-place without copying it first.&lt;/p&gt;</description></item><item><title>Re: Using infopath formula with filters and returning multiple results</title><link>https://www.infopathdev.com:443/forums/thread/34807.aspx</link><pubDate>Mon, 24 Nov 2008 14:56:51 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:34807</guid><dc:creator>Jo-Anne Alfafara</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/34807.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=34807</wfw:commentRss><description>&lt;p&gt;Hello and welcome to our forums!&lt;/p&gt;
&lt;p&gt;This tutorial might help you. &lt;a href="http://www.infopathdev.com/blogs/matt/archive/2006/04/18/Automatically-Populate-Fields-from-a-Drop_2D00_Down-Selection.aspx"&gt;http://www.infopathdev.com/blogs/matt/archive/2006/04/18/Automatically-Populate-Fields-from-a-Drop_2D00_Down-Selection.aspx&lt;/a&gt;. It uses text boxes to populate from xml. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Using infopath formula with filters and returning multiple results</title><link>https://www.infopathdev.com:443/forums/thread/34805.aspx</link><pubDate>Mon, 24 Nov 2008 14:37:32 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:34805</guid><dc:creator>h.elshabini</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/34805.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=34805</wfw:commentRss><description>&lt;p&gt;Thank you for your reply,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;but the steps you mentioned just populates the data in a drop down list, which is not helping me because the interface is totally isolated from the data in infopath,&lt;/p&gt;
&lt;p&gt;let&amp;#39;s say i have a data field in the main datasource = field1&lt;/p&gt;
&lt;p&gt;i need field1 to contain the values of all the roles in which this current user can be assigned. not the values chosen from the drop down, no....but i want for example to create a rule in the form rules, to fill field1 with all the values of this user&amp;#39;s roles.&lt;/p&gt;
&lt;p&gt;i mean i cannot actually make a drop down, and make the user choose from it his role, it has to be done automatically depending on other criteria.&lt;/p&gt;
&lt;p&gt;well anyways i tried to make that field1 repeating and tried another bunch of stuff....didn&amp;#39;t work either...always returns the first value it meets and thats it....&lt;/p&gt;
&lt;p&gt;however i made a workaround for now for my scenario, is that i wrote this &amp;quot;other criteria&amp;quot; i was talking about in the xml document right next to the username, and filtered using multiple values...&lt;/p&gt;
&lt;p&gt;but if anyone can plaese solve this for me, i&amp;#39;d be so gratfull&lt;/p&gt;</description></item><item><title>Re: Using infopath formula with filters and returning multiple results</title><link>https://www.infopathdev.com:443/forums/thread/34800.aspx</link><pubDate>Mon, 24 Nov 2008 13:47:05 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:34800</guid><dc:creator>swathip</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/34800.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=34800</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;How you are getting the values in the code. I think you are using selectSingleNode(&amp;quot;xpath&amp;quot;) method. Instead use selectNodes(&amp;quot;xpath&amp;quot;). So that you will get all the filtered values. Set these values to a repeating field in main data source and in the drop down properties select ‘look up values in the form&amp;#39;s source&amp;#39; and select the repeating field in the Entries box.&lt;/p&gt;
&lt;p&gt;You can achieve this functionality without code by using the below steps.&lt;/p&gt;
&lt;p&gt;1. Go to Drop down box properties.&lt;/p&gt;
&lt;p&gt;2. Select Look up values from an external data source.&lt;/p&gt;
&lt;p&gt;3. In the data source drop down, select the secondary connection.&lt;/p&gt;
&lt;p&gt;4. Select the role. Click Filter Data.&lt;/p&gt;
&lt;p&gt;5. Select username is equal to userName().&lt;/p&gt;
&lt;p&gt;6. Click ok to close all the windows.&lt;/p&gt;
&lt;p&gt;7. Make sure that name is selected in the value and Displaye Name fields.&lt;/p&gt;
&lt;p&gt;Finally the expression in the entries box should be like ‘/roles/role[users/username = xdUser:get-UserName()]&amp;#39;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Using infopath formula with filters and returning multiple results</title><link>https://www.infopathdev.com:443/forums/thread/34796.aspx</link><pubDate>Mon, 24 Nov 2008 12:06:03 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:34796</guid><dc:creator>h.elshabini</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/34796.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=34796</wfw:commentRss><description>&lt;p&gt;yes i know, but i need to retrieve these values in code, so they must be written to the main datasource. which i don&amp;#39;t think they exist in there if i just populate the drop down with the values, or do they?&lt;/p&gt;</description></item><item><title>Re: Using infopath formula with filters and returning multiple results</title><link>https://www.infopathdev.com:443/forums/thread/34793.aspx</link><pubDate>Mon, 24 Nov 2008 11:50:50 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:34793</guid><dc:creator>swathip</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/34793.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=34793</wfw:commentRss><description>&lt;p&gt;Hello and welcome to the forums,&lt;/p&gt;
&lt;p&gt;If you use this value in a text box then it will give the first result only.&lt;/p&gt;
&lt;p&gt;So use this filter in a drop down field to get all the occurrences of that specific filter. &lt;/p&gt;</description></item><item><title>Using infopath formula with filters and returning multiple results</title><link>https://www.infopathdev.com:443/forums/thread/34791.aspx</link><pubDate>Mon, 24 Nov 2008 11:29:52 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:34791</guid><dc:creator>h.elshabini</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/34791.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=34791</wfw:commentRss><description>&lt;p&gt;Hello, this is my first post i will try to be as brief and clear as i can, i am using infopath 2007 to create an infopath document to simulate some kind of a workflow.&lt;/p&gt;
&lt;p&gt;well anyways, i have a secondary datasource xml file called UserRoles.xml and this file contains the user names of my company and the roles they are allowed to choose from at some point during the document workflow based on other criteria of coarse.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;the datasource is like this:&lt;/p&gt;
&lt;p&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;&amp;lt;roles&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;role&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;name&amp;gt;Account Manager&amp;lt;/name&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;users&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;username&amp;gt;user1&amp;lt;/username&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;username&amp;gt;user2&amp;lt;/username&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;username&amp;gt;user3&amp;lt;/username&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/users&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/role&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;role&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;name&amp;gt;Proposal Manager&amp;lt;/name&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;users&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;username&amp;gt;user8&amp;lt;/username&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;username&amp;gt;user1&amp;lt;/username&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;username&amp;gt;user3&amp;lt;/username&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;username&amp;gt;user7&amp;lt;/username&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;username&amp;gt;user9&amp;lt;/username&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/users&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/role&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;role&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;name&amp;gt;Department Head&amp;lt;/name&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;users&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;username&amp;gt;user4&amp;lt;/username&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;username&amp;gt;user5&amp;lt;/username&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;username&amp;gt;user2&amp;lt;/username&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/users&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/role&amp;gt;&lt;br /&gt;&amp;lt;/roles&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;now as u can see, each single user might be a member of multiple roles, which is required in my workflow because at some point the user can do things based on his role as account manager then do something else based on his role as proposal manager.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;the problem is that how do i retreive which roles is this specific user assigned to?&lt;/p&gt;
&lt;p&gt;i get the user using the userName() function&lt;/p&gt;
&lt;p&gt;i create a repeating field called &amp;quot;fldAllowedUserRoles&amp;quot;&lt;/p&gt;
&lt;p&gt;and i make it&amp;#39;s default value like this: name[username = userName()]&lt;/p&gt;
&lt;p&gt;the problem is that this formula returns only the first occurance of this specific filter and exits, without checking if this case exists again further in the document.&lt;/p&gt;
&lt;p&gt;now how do i create a folrmula to return all the results for this specific username?&lt;/p&gt;</description></item></channel></rss>