# Filter data into kibana dashboard using post method

**URL:** <https://discuss.elastic.co/t/filter-data-into-kibana-dashboard-using-post-method/345001>\
**Category:** Kibana\
**Created:** [October 13, 2023, 12:33pm UTC](https://discuss.elastic.co/t/filter-data-into-kibana-dashboard-using-post-method/345001 "2023-10-13T12:33:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sujith\_Nair](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sujith_nair/32/119254_2.png) [@Sujith\_Nair](https://discuss.elastic.co/u/Sujith_Nair)\
**Post date:** [October 13, 2023, 12:33pm UTC](https://discuss.elastic.co/t/filter-data-into-kibana-dashboard-using-post-method/345001/1 "2023-10-13T12:33:17Z")

</div>

Hi Team,  
I would like to filter out data dynamically using javascript with the help of post method. I have used the a script but getting error in the post method. Attaching the script for your reference.

const kibanaDashboardURL = "";  
const postData = {  
// Your POST data here, if necessary  
};

fetch(kibanaDashboardURL, {  
method: 'POST',  
headers: {  
'Content-Type': 'application/json', // Adjust the content type if needed  
},  
body: JSON.stringify(postData), // Include POST data here  
})  
.then(response =\> {  
if (!response.ok) {  
throw new Error('Network response was not ok');  
}  
return response.text();  
})  
.then(data =\> {  
// Handle the data from the Kibana dashboard, if needed  
console.log(data);  
})  
.catch(error =\> {  
console.error('There was a problem with the fetch operation:', error);  
});

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 10, 2023, 12:33pm UTC](https://discuss.elastic.co/t/filter-data-into-kibana-dashboard-using-post-method/345001/2 "2023-11-10T12:33:25Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
