Sending a Field to a Popup

Good Morning and Happy Holidays Everyone,

Hoping one of you can give me a present with a great answer to this question.

Say I have a type “widget” with Fields like such

A
B
C
D
E
and so on

Now say those fields are all represented on the screen as buttons with text on them. For example button 1 reads field A. Each button represents a different field of which there are 25.

Now say I want to press button A and bring up a popup that just presents the information from field A. How do I send the field to the popup. I can send the whole widget to the popup but I just want specific fields from that widget to show up in the popup. I want the same popup for each field, rather then making 25 different popups. Also 25 conditional statements based on a state would be unwieldly.

So hoping for something I haven’t thought of.

Happy Holidays Again!!

You should be able to use a custom state without using a bunch of conditionals.

  1. Create a custom state for the popup (state = custState)
  2. Set the data source of the popup to “Popup A’s custState”
  3. When “A” is clicked => Set state of popup => custState = “A”

That way, all you have to do is set the state each time a button is clicked and the popup will read it as its new data source. No need for a bunch of conditional statements.

1 Like

You can also set the popup’s content type to whatever the field type is and send data. I created a test page for you then I came back and read @nnich19’s custom state solution which is very similar! I updated the page to show both methods.

Editor: https://bubble.io/page?type=page&name=button-to-popup&id=forum4&tab=tabs-2
Preview: https://forum4.bubbleapps.io/version-test/button-to-popup?debug_mode=true

The only snag you might run into is if the fields are different types (text, numbers, dates…) You may need to work with conditions in that case.

1 Like

Thank you both so much for your help with this issue. I have incorporated this into my app. Much appreciated!!!

Have a great Christmas:)

1 Like

Thank you sooooo much. I’ve been watching your very helpful videos that are mostly concise and short and quick to follow if one is looking for a simple answer. Your example link was perfect as I could investigate exactly what you selected all the way through.

I’m in prototyping phase but not the techie. When my techie comes on board I will definitely be sending him on your courses. But for now I have to prototype to get my concept correct.