I want to find a value in a sheet that is connected to a google form. But I dont know how. Here's what I want to do:

People are signing up to a meeting in a Google Form. The Form creates a Spreadsheet with peoples names, adresses, emailadresses etc. I want to send a confirmation mail with the information from the signup. People are asked to pay for the signup on a mobile app used in my country: mobilePay. If the user wants to pay via "mobilePay" i want to give them a sort of "booking number" in the confirmation mail.

So, I want to send a mail. I create a Google Script that - when triggered onSubmission - send that mail. That piece of code is pretty simple to make. But I want to create a function that either creates that booking number, or find that number in the spreadsheet. If I could create that booking number on the first sheet things would be a lot more easy, cause I could just link to it in the mail. But my spreadsheet will not let me create that column. Its removed whenever someone submits a new name. So I have to create that number on Sheet2 or in the script.

Are anyone able to help me out?