Based on template by @kuovonne ,
I want to use button to run the script. But I don’t want create two buttons.
My scenario is when Single Select field is “Not Started”, when I press the button, it will change to “In Progress”. When the field is “In Progress”, then I press the button again, it will change to “Completed”.
How do I achieve this?
There are many ways to do things in code. It is hard to tell if you are in the right track or not from your post. You can try running you code to see what happens. If you get error messages, try to figure out what they mean. Use
console.log to output variables to see their values. If you get stuck on something, post a screen shot of your code and the results of running it.
Your code is not producing any errors because it is grammatically correct code. However, it is not working properly because the logic for your code is wrong.
I recommend using
output.inspect() to show the values of variables so that you can better understand what is going on. For example, try
console.log(settings.singleselectField.id) and you will see that it is not the value that you expect.
What resources do you have for learning to code?
If you have not coded before, you may need to back up a bit to learn some of the basics.
If you do not know how to do something specific to Airtable, the scripting documentation has instructions, although you may need to dig a bit to find the exact info you want.
If you want personal coaching, I offer appointments.