fill in 2 values, receive the third - InfoPath Dev Sign in | Join | Help in Newbie Questions InfoPath (Entire Site) InfoPath Dev InfoPath Dev is dedicated to bringing you the information and tools you need to be successful in your Microsoft Office InfoPath development projects. Home Blogs Forums Photos Downloads InfoPath Dev » InfoPath » Newbie Questions » fill in 2 values, receive the third 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: Oldest to newest Newest to oldest Previous Next 11-10-2009 02:18 AM cyberdhine Joined on 11-10-2009 Holland Posts 25 fill in 2 values, receive the third Reply Contact 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 Qazi Anis Joined on 03-13-2009 Chicago Posts 1,025 Re: fill in 2 values, receive the third Mark as Not AnswerMark as Answer... Reply Contact hi cyberdhine, would you like to elaborate what you want to say, i cant get what you want Qazi AnisTechnical ArchitectBitwise Inc 11-10-2009 02:43 AM In reply to cyberdhine Joined on 11-10-2009 Holland Posts 25 Re: fill in 2 values, receive the third Mark as Not AnswerMark as Answer... Reply Contact 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 CE 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 cyberdhine Joined on 11-10-2009 Holland Posts 25 Re: fill in 2 values, receive the third matrix.zip Mark as Not AnswerMark as Answer... Reply Contact 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 Jimmy Joined on 07-03-2008 Posts 2,595 Re: fill in 2 values, receive the third SearchMatrix.xml Mark as Not AnswerMark as Answer... Reply Contact 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 MVPQdabra Software 11-15-2009 11:40 PM In reply to cyberdhine Joined on 11-10-2009 Holland Posts 25 Re: fill in 2 values, receive the third Mark as Not AnswerMark as Answer... Reply Contact 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 cyberdhine Joined on 11-10-2009 Holland Posts 25 Re: fill in 2 values, receive the third Mark as Not AnswerMark as Answer... Reply Contact 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 Jimmy Joined on 07-03-2008 Posts 2,595 Re: fill in 2 values, receive the third Mark as Not AnswerMark as Answer... Reply Contact 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 MVPQdabra Software 11-16-2009 07:07 AM In reply to cyberdhine Joined on 11-10-2009 Holland Posts 25 Re: fill in 2 values, receive the third form_and_searchmatrix.zip Mark as Not AnswerMark as Answer... Reply Contact 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 Jimmy Joined on 07-03-2008 Posts 2,595 Re: fill in 2 values, receive the third Mark as Not AnswerMark as Answer... Reply Contact 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 MVPQdabra Software 11-16-2009 11:29 PM In reply to cyberdhine Joined on 11-10-2009 Holland Posts 25 Re: fill in 2 values, receive the third Mark as Not AnswerMark as Answer... Reply Contact 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 Jimmy Joined on 07-03-2008 Posts 2,595 Re: fill in 2 values, receive the third Mark as Not AnswerMark as Answer... Reply Contact Could you attach your form again in its current state? Jimmy Rishe / Software Developer / Microsoft MVPQdabra Software 11-16-2009 11:46 PM In reply to cyberdhine Joined on 11-10-2009 Holland Posts 25 Re: fill in 2 values, receive the third form4_and_matrix.zip Mark as Not AnswerMark as Answer... Reply Contact Here it is. 11-20-2009 05:54 AM In reply to cyberdhine Joined on 11-10-2009 Holland Posts 25 Re: fill in 2 values, receive the third Mark as Not AnswerMark as Answer... Reply Contact No luck on this one yet. Any ideas? :) 11-20-2009 07:12 AM In reply to Jimmy Joined on 07-03-2008 Posts 2,595 Re: fill in 2 values, receive the third Mark as Not AnswerMark as Answer... Reply Contact 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 MVPQdabra Software Page 1 of 2 (28 items) 1 2 Next > Copyright © 2003-2019 Qdabra Software. All rights reserved.View our Terms of Use.
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!
hi cyberdhine,
would you like to elaborate what you want to say, i cant get what you want
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 CE 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!
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!
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
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!
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".
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)?
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!
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]
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...
Could you attach your form again in its current state?
Here it is.
No luck on this one yet.
Any ideas? :)
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?