# Get the EventDetail object on the Event Details Pay

**URL:** <https://forum.wixstudio.com/t/get-the-eventdetail-object-on-the-event-details-pay/59220>\
**Category:** Ask the community\
**Tags:** wix-events-v2, api, question, code, wix-studio\
**Created:** [May 14, 2024, 7:44pm UTC](https://forum.wixstudio.com/t/get-the-eventdetail-object-on-the-event-details-pay/59220 "2024-05-14T19:44:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Laura\_Heritage](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/laura_heritage/32/83247_2.png) [@Laura\_Heritage](https://forum.wixstudio.com/u/Laura_Heritage)\
**Post date:** [May 14, 2024, 7:44pm UTC](https://forum.wixstudio.com/t/get-the-eventdetail-object-on-the-event-details-pay/59220/1 "2024-05-14T19:44:04Z")

</div>

**Question:**  
I can not figure out how to get the EventDetails when I am working on the Event Details page. I want be able to create a custom butten that uses the value that is in the Event Details Location Name field when you create the event through the UI.

I can’t figure out how to access that information. Any one got a code example? I am trying to use Velo and I see the wix-events.v2, but it always requires the eventID to get the object. I don’t know how to get the eventID from the current page being displayed. All the examples show a hardcode event title search.

**Product:**  
The latest wix edition, i think.

**What are you trying to achieve:**  
I am trying to get the LocationName field from the Events Data in order to populate the custom Button I put on the Events Detail pages. This button is to use the url I put in the LocationName field when filling out the event.  
**What have you already tried:**  
[  
import wixData from ‘wix-data’;  
import { local } from ‘wix-storage’;

import { wixEventsV2 } from ‘wix-events.v2’;

$w.onReady(function () {

```
// Write your Javascript code here using the Velo framework API

// Print hello world:
// console.log("Hello world!");

// Call functions on page elements, e.g.:
// $w("#button1").label = "Click me!";

// Click "Run", or Preview your site, to execute your code

console.trace("On Run Started" );
const myeventpromise = wixEventsV2.findEvent();
console.trace("what the heck");

```

wixData.query(“Events/Events”)  
.find()  
.then( (results) =\> {  
// handle the results  
console.trace(“got wix data” + results.items[0].l);  
} );

```
$w("#button27").link = "http://www.openfinity.org";

```

});

/\*\*

- Adds an event handler that runs when the element is clicked.  
[Read more](https://www.wix.com/corvid/reference/$w.ClickableMixin.html#onClick)
- @param {$w.MouseEvent} event  
\*/  
export function button27\_click(event) {  
// This function was added from the Properties & Events panel. To learn more, visit [Working with the Properties & Events Panel](http://wix.to/UcBnC-4)  
// Add your code for this event here:

}

**Additional information:**
