It depends on how you want to return the data.
If you want to return the data as JSON, you can create a published REST service with an export mapping to do this.
https://docs.mendix.com/howto/integration/publish-rest-service/
If you want to go to a page with the specific data on, you will need to use either a Page URL which can return a page that shows an object with the data on, or a Deeplink (before Mx10.6) or Microflow URL (Mx 10.6 or later) to build the data and return a page.
https://docs.mendix.com/refguide/page-properties/#url
https://docs.mendix.com/appstore/modules/deep-link/
https://docs.mendix.com/refguide/microflow/#url
I hope this helps.