Hi, I am trying to get the database to update the number of guests of an attendee to be zero when the attendee marks themselves not attending. At the moment, if the attendee previously marked themselves as attending and had guests, then when I mark the attendee as not attending, I cannot seem to get the database to update.
I have tried to put in a condition that when the dropdown’s value is “no” (or “No”, neither works), this input’s content is 0, (I ahve tried all sorts of combinations) but that doesn’t seem to work…
Hi J805, thanks, yes, I am trying to change the database.
My intention is for this condition to change the number here to zero, and then for the action of pressing the Submit button to cause the database to update.
I have change the capitalisation, but it still doesn’t work.
I am not sure what you mean by change the fields on the current user, but I have tried to change a conditional on the Current User’s Attendance so that when it is No, the Input number of guests value to be zero, but that hasn’t worked either…
Hmm . That’s a tough one. So that condition won’t work because I think it is a circular reference. It is referring to itself in a way.
If your dropdown says no, you are changing the dropdown’s default value. The default value won’t work because you are checking a condition on the input.
Right now it says: ‘Input Number of guest’s value is 0’ which will return either ‘yes’ or ‘no’. Not capitalized.
I think you have the conditions in the wrong place and the conditions are incorrect. Let me try to set up an example for you since it’s hard to explain everything here. It might just confuse you more.
Let me set it up and I will come back and post the links here.
Hi there, @StandUp… I’m sure Jason’s got you covered with the example he is going to create, but for what it’s worth, the first screenshot in your first post is on the right track, but it doesn’t work because the initial content of the input is not reevaluated when the dropdown’s value is changed. If you put the input in a group and set the group’s data source to a value (in your case, 0) when a particular option (in your case, the No option) is selected from the dropdown and you set the initial content of the input to the parent group’s data, you would get the desired result. You can also do it by setting a custom state to a value when the dropdown’s value is changed, and set the input’s initial content to the custom state’s value.
Anyway, like I said, I’m sure Jason’s example will show you the way, but that’s what is going on there.
Hi J805, that doesn’t seem to do it - if I set the number of guests to more than 0 (i.e. 9), and then set attending to No, then the number of guests should return to zero…
Ok, this is how I would do it then. Try it now. It was previous only saving it after you pressed the button. Would this work for you? Or I can show a different way if this doesn’t work for what you are looking for.
I’m definitely not trying to be a jerk here, but it should be noted that if your form has a way for the user to cancel their selections, @StandUp, canceling will do nothing because the input’s values are being saved to the database when the inputs are changed. If you don’t want that to happen, you would need to do something like what I described. If it doesn’t really matter, you can do what Jason is showing, and the submit button is basically redundant at that point.
Yeah, @mikeloc that’s the other way I was going to show if this wasn’t going to satisfy what they needed. You aren’t being a jerk. I tried to give the simplest example first, then if it doesn’t work, I would add complexity. Like using states or a parent group like you said. There is always more than one way to do something. No offense taken here for sure.
Hi Mike, Jason, thanks both for your help in this, really very much appreciated.
Jason, very sorry, I am lost as to get to there through the workflows, I still can’t see what you have done. Yes please to a little more info on what you did.
Mike, I am not sure. If the user tries to update the number of guests and then sets their own attendance to no, I need the database guest number to be set to 0…
I am sorry, but I got lost in your explanation too. It would be amazing if you could give a bit more detail to explain your solution too so that I can learn from it.
Apologies to both that I need the extra explanation! And thanks again. I am getting there, and I most certainly will get there!
Ok, I just modified it a bit by removing the workflow on the submit button. You really don’t need it since the workflows are happening on when the input or dropdown has changed. What is your workflow doing? Maybe a screenshot of the workflow might help, or even better, share your editor. You can send me a direct message so you don’t have to expose it here.