fill in 2 values, receive the third - InfoPath Dev
in

InfoPath Dev

fill in 2 values, receive the third

Last post 12-03-2009 12:32 AM by cyberdhine. 27 replies.
Page 1 of 2 (28 items) 1 2 Next >
Sort Posts: Previous Next
  • 11-10-2009 02:18 AM

    fill in 2 values, receive the third

    Hello,

    I was trying to create something in Excel, but discoverd the power of Infopath, and like to learn more about it.
    I'm making a form for users to fill in some values, and the form will return some values.

    Now the idea is this: I have an search-matrix in Excel. Infopath has to look horizontally an vertically in this matrix, and return the right value.

    Is this possible? Thanks!

  • 11-10-2009 02:35 AM In reply to

    Re: fill in 2 values, receive the third

    hi cyberdhine,

    would you like to elaborate what you want to say, i cant get what you want

    Qazi Anis
    Technical Architect
    Bitwise Inc
  • 11-10-2009 02:43 AM In reply to

    Re: fill in 2 values, receive the third

    Hello Qazi,

    firstly thank you for the fast reply!
    I have a form, with 2 boxes. In these boxes users must type a value.

    So with these 2 values, Infopath should go search in a table (inside or outside Infopath?) And find the corresponding value.

     Small example:
    Matrix:
            A     B      C
    E      1      2      3

    F      4      5      6

    G     7      8      9

    So if a user gives the values "B" & "G", infopath should fill in another box with the value "8".

     

    I hope you get me now? 
    Thanks! 

     

  • 11-12-2009 04:45 AM In reply to

    Re: fill in 2 values, receive the third

    Update:

    For everyone who would like to look into this, I will hereby provide the some files.
    The zip contains one excel sheet, on which the search table is. Further one JPG to show what I'm trying to achieve.

    Thanks!

  • 11-12-2009 06:22 AM In reply to

    Re: fill in 2 values, receive the third

     This is entirely possible in InfoPath, but you need to put the data in a format that InfoPath will understand.  This is a little tricky when the original data is in Excel.  I created and ran an XSL transform on the data in your spreadsheet to produce the attached XML file.  This can then be added as a secondary data source in InfoPath, and then retrieving data from it when you want just requires a bit of rudimentary XPath.  I recommend getting up to speed on XPath if you are not very familiar with it yet.

     http://www.w3schools.com/XPath/default.asp

     

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 11-15-2009 11:40 PM In reply to

    Re: fill in 2 values, receive the third

    Hello Jimmy,

    thank you very much for the xml-file. I've tried to find a program that could create such a list for me, but could'nt find one. This is great!
    I've been reading a lot of chapters concerning the xpath, but it's still all very "rocket-sciency" to me.

    I think I'll just go and try some things...I guess I should make some kind of formula which refers to the values of the two drop-down boxes, and searches for the corresponding value in the xml document?

    Hmmm, well, wil go and try!

    Thanks!

  • 11-16-2009 12:34 AM In reply to

    Re: fill in 2 values, receive the third

    Right now using this formula:

    xdXDocument:GetDOM("SearchMatrix")/data/dataRow[@rowValue = "../my:Alpha"]/dataCell/@colValue = "../my:Beta"

    the editor says: "the formula contains no errors".
    But when I test my form, the output is the value "false" instead of the correct value.

    I filled the two boxes "alpha" & "Beta" with the values of the "searchmatrix".

  • 11-16-2009 06:33 AM In reply to

    Re: fill in 2 values, receive the third

     Nice attempt.  Please see if this formula works:

     xdXDocument:GetDOM("SearchMatrix")/data/dataRow[@rowValue = current()/../my:Alpha]/dataCell[@colValue = current()/../my:Beta]

     If that doesn't work, could you tell me where you are using this formula (in a default value, rule, etc.) and attach a screenshot of your main data source (from the taskpane)?

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 11-16-2009 07:07 AM In reply to

    Hmm,

    That one doesn't seem to work either.
    Maybe it's not in the formula itself, but in the type of boxes? Or other settings?

    To be sure I've attached the form & the search-matrix. I've modified the xml a littlebit to make sure all values are 2 decimals.

    Take a look, hope you can find something!

  • 11-16-2009 07:24 AM In reply to

    Re: fill in 2 values, receive the third

     In your formula, you're matching rowValue against Alpha and colValue against Beta, but actually rowValue corresponds to Beta and colValue corresponds to Alpha.

     This formula should work:

     xdXDocument:GetDOM("SearchMatrix")/data/dataRow[@rowValue = current()/../my:Beta]/dataCell[@colValue = current()/../my:Alpha]

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 11-16-2009 11:29 PM In reply to

    Re: fill in 2 values, receive the third

    Yes,

    I've noticed I had switched the values, but I've corrected that in my drop-downlists.
    You should think this formula would work, but it doesn't!

    Very strange...

  • 11-16-2009 11:34 PM In reply to

    Re: fill in 2 values, receive the third

     Could you attach your form again in its current state?

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 11-16-2009 11:46 PM In reply to

    Re: fill in 2 values, receive the third

    Here it is.

  • 11-20-2009 05:54 AM In reply to

    Re: fill in 2 values, receive the third

    No luck on this one yet.

    Any ideas? :)

  • 11-20-2009 07:12 AM In reply to

    Re: fill in 2 values, receive the third

     Sorry for not responding sooner.  It seems I missed your post.  I tried opening the latest form you attached in Preview mode, adding a row to the table, selecting a value for a and b, and Cb is showing the corresponding value just fine.  What happens when you try that?

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
Page 1 of 2 (28 items) 1 2 Next >
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.