How to hide elements with a particular condition

Hello,

I need your help :slightly_smiling_face:
I’ve created an Account popup where I create data and edit it, and a Contact popup (idem).

My question are:

  1. When I’m in my “account” tab/section and I display my create an account popup, I’d like to give the user the option of creating a new contact if the contact isn’t in the dropdown list (associated contact) by adding it via the (user-plus) button.
    To do this I’ve created a workflow that displays my contact popup. The problem is that when the create contact popup is displayed, it shows items that I don’t want. In this case I don’t want to display the button (suitcase-simple) and I don’t want to display the dropdown (associated account).
    Similarly, when I edit the account, after clicking on my button ( user-plus), I also don’t want to display the button ( suitcase-simple) and I don’t want to display the dropdown ( associated account).

  2. When I’m in my “contact” tab/section and I display my create a contact popup, I’d like to give the user the option of creating a new account if the account isn’t in the dropdown list (associated account) by adding it via the (suitcase-simple) button.
    To do this I’ve created a workflow that displays my account popup. The problem is that when the create an account popup is displayed, it shows items that I don’t want. In this case I don’t want to display the button (contact-plus) and I don’t want to display the dropdown (associated contact).

Or perhaps you have another solution? :thinking:

Thank you very much :star_struck:

Mel

  1. Compte → Create popup

Compte → Edit popup

  1. Contact → Create popup

assuming the contact popup is a reusable, add states to it that are used on elements you may want to hide (e.g., show X element only when popup state X = X). Then whenever you are showing the popup set the states you want to hide/display the fields you want.

Tip: All states and the group itself can be set via a CE within the REU so that it’s all centralized (easier to keep track of what states impact what elements).

Thank you very much @code-escapee :slightly_smiling_face: for your reply, but I’m new to Bubble and I’m getting a bit lost in these explanations.

Before you build read the manual thoroughly and @petter’s book

Thank you @code-escapee for this advice :wink: but I prefer to build at the same time as learn, it allows me to see immediately what I understand and what I do not understand with real exercises. I will check the link and I test at the same time the solution with customs state. Thanks a lot!

I’m the same way. But then learn instead of asking for help and then informing those who reply that you’re new to Bubble and don’t get the reply :wink:

It’s thanks to the answers on this forum that I’m learning more (to each their method).
It’s also thanks to your reply that I’ve been able to research the use of custom states in this particular case.
I succeeded in one way (popup account) with the custom state now I try to see how I can solve the problem in the other direction (popup contact) and if I do not have my answer well I will ask for help in this forum (which is made for that) with the mention novice (for certain function of bubble).
Have a nice weekend and thank you again for your help! :wink:

1 Like