Issues with IMPORTXML Data Extraction in Google Sheets

Using a custom XML import, I’m trying to fetch a sell price into Google Sheets, but the code returns placeholders.

=FETCH_XML("DATA_SOURCE", "//*[@data-price='sell']")

I have dealt with similar issues when attempting to extract dynamic XML data into Google Sheets. In my experience, the problem often lies in how the XPath is constructed and how the custom function is implemented. It is crucial to ensure that the target element exists in the document and that the attribute and its value are matched exactly as they appear in the source XML. I also encountered cases where the function might not update dynamically because of cache or refresh issues. Double-check the data source response and confirm that the XML tags are not nested in a way that obscures the matching criteria. A small tweak in the XPath or forcing a sheet refresh helped resolve the issue on my end.