The requirement is to return the item id in the query string on button click. I added a template in the rendering variant and added the following line
<a href="https://some url?itemid=$item.ID">Button text</a>
Now, I want button text to come from the sitecore field. $item.fieldName is not working. What is the right way of reading the text from the sitecore field in this case?