Any efficient way to do this?

You can’t ask people to write the entire script for you.

You’ve been given three different working solutions for what you’re asking for - the problems you’re being confused by are basic topics that you can find answers on via the DevHub:

1 Like