I have an infopath form with two dropdown lists and depending on the vaues I have to choose the value in another third dropdown list, I have 40 possible combinations and I don't want to create 40 rules to rule the final dropdown list, there is a logic like a switch condition like in programaming c#?
There is no 'switch' or 'case/select' command in InfoPath. If you want to avoid a multitude of rules, you can set up a SharePoint list with the possible combinations in two columns and the value to retrieve in a third column. Then use a data connection in InfoPath.
Set the query fields of the list to the two values chosen in the dropdowns and then query the data source. If you have multiple matches, you can feed another dropdown with the result. If you have a single match, you can assign it to a field immediately.