That gray group doesn’t appear when the page is loaded. It just appears in case of, when hitting the blue saving button, there is any empty field left behind. Also it shows which field is still needed to be filled. If “Valor” and “Categoria” then both are there also. If every field is filled, then saving is allowed and workflow goes through.
So whenever I hit the blue saving button again, for example: if “Valor” is still empty but the others aren’t, then just “Valor” black tag is displayed showing that it still needs to be filled to be saved.
How would you guys do it? create 5 custom states,… etc?
I don’t know if i get it, but if i do, the answer is pretty simple
You just have to create a custom state for each input (is_filled=yes/no). And in the save button, you’ll execute the workflow only when each input 's custom state is no.
And for the group that shows what the user has to fill, you create a tag for each input, with a conditional that goes:
When input’ is filled=no
text: input’s name
When input’ is filled=yes
this element isn’t visible
And the group conditional will be: when input1’ is filled=yes and input1’ is filled=yes… This element isn’t visible
That can work. You can also just simplify it with the custom states being texts and containing the validation message (this allows for different options if an input is not empty but outside a range etc) so it all works hand in hand.
All you need to do is set a conditional onto the grey group (I suppose there is one grey group for each input - OR - one text element for each input, in which case you need to set a conditional onto each text element).
You also need a custom state to determine if the blue button has been pressed or not, so add a custom state to the blue button that is ‘pressed’ and is of type yes/no.
The conditional for the text or grey group that needs to verify if the Valor input is not empty, all you need to do is set a condition like the one below
When input valor value is empty and blue button pressed is yes with changing property of ‘this element is visible’
With the and operator in the conditional expression it will make it so the text or grey group only appears once the user has pressed the blue button.
You could alternatively use a conditional that is input value is not validand for each input check the box for ‘this input must not be empty’ and then when the user presses the blue button make sure that the workflow actions contain an action that utilizes the values of the input elements, so that automatically Bubble will determine the input value is not valid when the input value is empty.
Hi Boston,
In all cases except this one it might work nicely as you described. Thanks man.
However, in this case, this group is within a repeating group with auto bind. Whenever a user clicks to save all the data it is already saved and workflows justs directs to “Go to Page” xyz.
I’m trying to work around this using almost everything what you said about those conditions. Works fine.
Currently is like this: when page is loaded, and if there is any empty required field, the group appears and displays within the repeating group which field is empy for each cell of Operations. If it is fulfilled, automatically, those fields which were required starts to disappear accordingly.
It would be nice if those alerts and groups would appear only when save button is clicked. Then just trigger a “Only when” in workflow when there is no empty field in any required cell of any Operations within the repeating group. But that would take alot of work to stop the user to save operations within a repeating group with empty required fields.
I’ve tried to set state whenever the group (within repeating group) is invisible to ‘yes’ but in the workflow I can’t reference individually those groups within in the repeating group. They simply don’t appear to be choosed from.
So I’m kinda in a stale mate here. Have you any idea?
And then be like this when hitting save button but required fields are still empty and it doesn’t trigger “save” and then “go to page” when required conditions aren’t met:
Any element inside of a repeating group can not be called individually from outside the repeating group because Bubble expects that an element in a repeating group will be multiplied (ie: one for each cell of the repeating group), so any actions or conditions that are needed for elements within a repeating group must be done inside of the repeating group.
There is a free plugin that allows us to run actions from outside the repeating group on multiple or individual cells within the repeating group and I believe it is called “Orchestra”.