I’m trying to do a movie import from themoviedb, and I have a couple boolean prompts with questions for some extra data I want to add. I.e.:
- watched: this sets
watched
to true, and also sets watchedDate to current date. - with wife: if I watched with my wife or alone. If yes, adds her to
watchedWithPeople
. Otherwise, that’s an empty string (since I guess we need to join arrays in a string.
The problem is that false
and ""
makes QuickAdd prompt me for the values again.
Script Code:
const withWife = await QuickAdd.quickAddApi.yesNoPrompt("with wife?");
const watched = await QuickAdd.quickAddApi.yesNoPrompt("watched now?");
QuickAdd.variables = {
...movie,
withPeople: withWife ? "Lu" : "",
watched: watched,
watchedDates: watched ? new Date().toISOString() : "",
Template:
withPeople: {{VALUE:withPeople}}
watched: {{VALUE:watched}}
watchedDates: {{VALUE:watchedDates}}