Hi,
I have a problem driving me crazy and I have tried multiple approaches to solve this, but none are working currently.
I need to set the value of a field in my form based on the selection of a value in a dropdown, sound easy right (I really miss the IF statements in excel:-))?
I have a large and complicated form, so I can not add all details, but here are the basics (using InfoPath 2013, but form compatibility is for 2010):
All fields below are in a repeating table/section.
I have two fields containing pretty complicated calculated values, lets call them calculatedfield1 and calculatedfield2. I have a dropdown containing three different selections, lets call it selectionfield.
Based on selection in selectionfield, I want fieldA to be populated with the result of calculationfield1 or calculationfield2.
My preferred solution would be to do this by applying default value and filtering directly on fieldA, but as the calculationfield1 and calculationfield2 are separate, this does not work.
I then tried to add calculationfield1 and calculationfield2 as a repeating table with pre-populated values to be able to apply filtering, this does not work based on the fact that pre-populated values seem to only support static data, if I add the different calculations used for calculationfield1 and calculationfield2 as pre-populated values, only one of the calculations will be populated for all rows in the table.
I then added calculationfield1 and calculationfield2 as an xml data source and copied in the full xpath for the calculations in two rows in that data source and applied the filtering, but this only returns the actual calculation (xpath) in fieldA, not a calculated result.
I then tried to apply rules to selectionfield to set the value of fieldA depending on text filter on selectionfield, but this does not work at all and behaves very strange. First of all, it does not seem to fire of when I expect it (I'm not a friend of rules), but more peculiar is that it is not setting the correct values from calculatedfield1 or calculatedfield2, but other values not present in calculatedfield1 or calculatedfield2...?
Sad to say, I can not attach my form as it contains sensitive data, but I hope you get the picture and can offer some thing that I can try.
My preferred solution would be to be able to apply filtering or logic directly on fieldA, not rules.
Best regards
/Micke