Yes, you can use that. One thing, this value need to be present inside gallery, so create a label that has the ID column on its text property, Lets say ThisItem.ID and the name of label is Label1. You can set its visible property to false if you do not want to dislay it. Make sure the label is inside the gallery.
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!