Hi Hilary,
I am having a similar problem, I have a receive data connection that receives data from a web service method that requires an input parameter, which pulls data from a database. When I create the data connection, I set the value to a Username (pk) in the database. But I need this to be determined dynamically in the form (every employee has a unique username, so I am using set a default text box username() function, and I want to pass in that value as the parameter ). How do I do this?
I saw that you mentioned using rules to do this, so I have tried to use the field that pulls userName(), and put a rule on it to set the queryField in my data connection to this fields value. but when I preview the form, I get this error: There is an error in XML document (1, 434). ---> System.FormatException: Input string was not in a correct format.
This userName parameter is definitely a string throughout my web service, stored procedure, and table, and the text box in InfoPath is a string, so Im not sure why this happens. If I try to preview a new form with this only this data connection, and not even any text boxes, I get the same error when the form loads.
Any ideas? Thank for your help