This means you did something. Then you found out something because of it. It shows the result of your action.
に、。
When I had the doctor examine me, I was told it was just a cold.
、。
When I searched the internet, I couldn't find any articles regarding that matter.
に、。
When I asked the station attendant, they said the next train is in 10 minutes.
、。
When I tried the new recipe, I found it was surprisingly easy to make.
、。
It was when we checked the security camera that we realized he was the culprit.