A compound represented by the formula (I): wherein each symbol is as defined in the specification, and a salt thereof have a GPR40 receptor activation action and is useful as an insulin secretagogue or a prophylactic or therapeutic drug for diabetes and the like.