Hi Lan-Huang,
Are you working with a SharePoint list or library? if so then you should be able to find the filter at the secondary data source's query fields. At the right side of your InfoPath form, select the data source connection and expand the Query Field section. Configure your button to set these field's ID field to the ID text box you have placed on your form. Once you have this rule on your button, set another rule to query this connection. The returned value/s should be the ID you have specified on your text box.
Once you have this logic working, then the value of the secondary source's fields to the corresponding main data source fields. I hope this makes sense.
Regards,