Rules/Conditions - InfoPath Dev
in

InfoPath Dev

Rules/Conditions

Last post 04-23-2013 02:13 PM by Jimmy. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 04-23-2013 12:07 PM

    • Rob Kocher
    • Not Ranked
      Male
    • Joined on 06-13-2012
    • Southeastern PA, USA
    • Posts 2

    Rules/Conditions

    I know there are lots of variations of the different rules, but I cannot seem to find any detailed instructions on how to use the 'Filter Data' option when creating rules or what it does.  The reference is always just, 'click Filter Data button' and on to the next step. 

    What I am trying to do is the following:

    1.  The user selects a department name from a dropdown control (list items are from a data connection - no problem).

    2.  I want the dept number control to auto-populate, referencing the above data connection and pulling the correlating dept # value.  Should the function be:  DepartmentName[@Department_Name = @Dept_ID]      (I think what I'm saying is the DepartmentName value on the form is querying the Department_Name of the data connectoin and returning the value of the correlating Dept_ID)  The DepartmentName field is a value on the main connection.  Then, using the Filter data button, I selected secondary data connection for Department_Name and said that it is equal to the value in the Dept_ID column on the list for the item with the same Department_Name as that selected in the #1.

    3.  The last piece is to auto-populate the approver of the form.  Here is that formula:  Dept_ID[@Role = "Approver" and @Dept_ID = @Title__UserName_]

    The approvers are on a different data connection (UserPermissions).   I want to look at the Dept_ID that was populated in #2, compare it to the DeptID on this list.  I also need to make sure that the Role is set to Approver for this DeptID.  If this is true, then pull the Approver's name from the list and populate the Approver textbox control.

    If anyone can tell me I'm right or wrong, I would greatly appreciate it.

  • 04-23-2013 01:27 PM In reply to

    2.

    I believe the formula would look something like row[@DepartmentName = DepartmentName]/@Dept_ID You can achieve this by selecting the @Dept_ID field and adding a filter with the condition @Department_Name = DepartmentName (from the main data source).

    3.

    I believe the formula would look something like row[@Role = "Approver" and @Dept_ID = DeptID]/@Title__UserName_ You can achieve this by selecting hte @Title__UserName_ field, and adding a filter with the condition @Role = "Approver" AND @Dept_ID = DeptID (from the main data source).

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 04-23-2013 02:00 PM In reply to

    • Rob Kocher
    • Not Ranked
      Male
    • Joined on 06-13-2012
    • Southeastern PA, USA
    • Posts 2

    Thanks Jimmy.  Just a quick question for the two Dept. names - The first one - is it the value on the form or the first secondary data connection?  And the second, the value in the second secondary data connection?

    There are two different lists pulling the information.  I could combine them and maybe that would be easier.

  • 04-23-2013 02:13 PM In reply to

    In the first one, you should use the condition editor to select the DepartmentName from the secondary data connection on the left side and the one from the form on the right side of the comparison. Likewise for the DeptID.
    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.