Verify data between two SQL table data connections - Browser based form - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Verify data between two SQL table data connections - Browser based form

Last post 07-30-2012 08:07 PM by Edwin Brito. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 07-30-2012 02:20 PM

    • Big E
    • Top 500 Contributor
      Male
    • Joined on 02-18-2009
    • Alabama
    • Posts 34

    Verify data between two SQL table data connections - Browser based form

    Alright, here is the skinny.  I have two sql tables that I am pulling in for a read only data connection.  I have setup a udc connection for both of these and they are working fine.  What I am trying to do is write a value to a field from one dataconnection based on a condition from the second data connection.

    I currently get the value of 'Zip Code' by creating a conditional filter on the datasources.  Here is the xpath for that statement:
    xdXDocument:GetDOM("DATABASE_TABLE1")/dfs:myFields/dfs:dataFields/d:DATABASE_TABLE_1/@ZIP_CODE[../@EMPLID = current()]
    Simple enough.  I receive the value of the first name based on the current employee ID that was selected in the dropdown that is performed by a rule.

    Based on this, I would like to get a location name from a different datasource (DATABASE_TABLE_2) and have the data match up based on the zip code in DATABASE_TABLE_1.  Since the zip code would be the primary key in both data sources, I figure this would be the way to go.

    I am having issues trying to get this worked out.  Does anyone know if this seems like it could work?

    Thanks,
    Eric

  • 07-30-2012 08:07 PM In reply to

    Re: Verify data between two SQL table data connections - Browser based form

    Without an screenshot is a little difficult to visualize your scenario. As far as I understand, it seems that this can be solve using a rule that assigns a value to the filed you want to calculate. A filter might be requiered to filter the value based on the parameters you defined.

    Create a filed called 'location' 

    Select the variable field ('employeeID') and create a rule called "Location"

       Conditions: None

       Rule Type: Action

       Run these actions

          Set field value

            Field: Location

            Value: click on "fx"  > In the Insert formula dialog box:

                    "Insert filed or Group..."  > Navigate to the location you want to insert from the data connection (secondary)

                      Click on: "Filter the data..." > "Add..." > Create a condition where the Zip Code on the main connection is equal to the Zip Code on the secondary connection.

                              

    ,

    EB
Page 1 of 1 (2 items)
Copyright © 2003-2018 Qdabra Software. All rights reserved.
View our Terms of Use.