This article discusses about a customized approach to get user input when clicked on a UI action on the Mobile Classic app in servicenow.
onClick field is not available for mobile ui actions. This is behavior by design. Hence there is no provision to get input from user when a UI Action is clicked on mobile platform.
One possible solution is :
1) Create a new field on the form
2) Add this field to the mobile view
3) When UI action is clicked
a) Check if field is checked. If yes, proceed with the UI action
b) If Not selected/filled, abort action and use gs.addErrorMessage to show an message to user to select/fill the field to execute the UI action.