I have a form where the user inputs a list of drugs they are currently taking. Under each Rich Text Editor response box there is a dropdown menu which the user indicates through it whether they have completed the response, or whether or not its not applicable to them. When the user selects Completed or NA the RTE above it becomes disabled as to lock in their response. All this is working fine.
The issue I have is - when the user comes back to the reseted form to complete it again for a new drug, the RTE is disabled because its picking up the Complete or NA status of the âfirst itemâ data submitted previously. Iâm struggling to come up with the right expression for the condition so its not reading the âfirst itemâ in the table, but instead only scanning to see if Complete or NA is present for the current drug entry that is about to be entered, if that makes sense.
This is the front end form and drop down âstatusâ selection menu:
Here is my conditional for disabling the RTE. As explained above, I think its disabling this because itâs scanning any first instance of the selection âYes Lock Sectionâ or âNot applicableâ
The question is, instead of âfirst itemâ, whatâs the right expression so it only picks up the selection corresponding to the row of data its dealing with at the time instead of any first instance that appears in the table?
Hi there, @JS7319⌠if I understand your post correctly, it seems like the issue could be related to the fact that you are doing searches in your condition instead of referring to something like the current pageâs or parent groupâs item.
Based on that statement, it sounds like the user might be returning to the form by selecting an existing item from a table, and the form is pre-populated with the selectionâs data. If that is the case, you shouldnât have to search for anything because you should be sending the selection to the form, and then you can refer directly to the selectionâs data.
Without knowing more about your setup, itâs hard to be more specific than that, but I hope this reply helps. If it doesnât, maybe you can share more screenshots, and Iâm sure someone will be able to help you figure this one out.
I think you might be right on the point of pointing to the parentâs group item. I understand that I need to stop asking it to look into the database and move away from âdo a search forâ, so when the user refreshes the page it will be a blank slate to enter new data and then save that (and therefore Bubble shouldnât be searching for anything from previous entries and thereby changing anything on a blank form - such as disabling the editor because its picked up the most recent saved condition).
I implemented a parentâs group conditional here as suggested, and so far when I refresh the page the RTE I am testing it on isnât disabled (unlike the other RTE which is as it hasnât been changed yet). However, weirdly, the disable function isnât being implemented at all even when itâs supposed when I select the dropdown option that should trigger it. As you can see below, the condition has some changes to the colour, and is supposed to disable the editor, but itâs not doing that one part of the condition.
All the other conditional elements look like theyâre being implement except the most important, disabling of the RTE:
In that particular example, does the parent group have data associated with it or are you creating a new thing? Maybe try adding an âorâ to your expression that says or the dropdownâs value is Yes - Lock Section.
This is a blank form, and so when the user hits save they will be creating a new thing.
Itâs peculiar as its not working either. I have written out the full expression, with âisâ and âis Displayâ - there is no âis valueâ. I have done this for both âyesâ and âNAâ
Itâs picking up all other elements of the expression but not the disabling one.
But youâre referring to the parent group each time. I may not understand what you are doing here, but I believe the parent group will only have data if the user is editing an existing thing. If the user is creating a new thing, then you canât refer to the parent group in the condition. You likely need a new condition that refers directly to the dropdownâs value.
Yes, I think the parent group thing wonât apply here because its not reading whatâs already in the table (as it wonât exist for this entry).
I have gone with the below expression to apply the condition based on the current value of the dropdown. So far it looks like its behaving the way I want:
Looking at that I donât know why I didnât think of it after all this (I think itâs because most of my app actually uses the parent/do a search for expression successfully elsewhere, so had to just realise this expression also works on the current value in real time too).