Thank you for contacting us and for your question.
To see more information along the lines of the requested functionality, please refer to the following article. Review the code, and see how it is applicable to your case. If any other questions aries, please let me know.