Orchestra plugin - last mile issue

Hi all! I’m having a lot of trouble with getting Orchestra to work properly for me and I’m not sure what I’m missing.

I’m testing out a very basic setup:

I have a maestro on my page and a musician inside a repeating group. For testing purposes, I just have a musician that is revealed and initialized on page load. I also set it’s class as you can see below.

After, I set the workflow of what the musician will do inside each row of the repeating group. In my specific case, I’m creating a new entry for a data type called “Answer” and adding the value’s of two inputs into two fields within the “Answer” data type. They’re essentially fields for what the question that is being answered is and what is the answer that a user types up. Then, I’m taking the result of the Answer that was just created and adding it to a custom state. The custom state (Collected_Answers) is created on the Repeating Group element for scope reasons.

This is where things don’t work. I go to trigger the musicians when a button is clicked, and the Answers are not being added to a separate data type called “Responses” like they should be.


I’ve tried adding a pause after the trigger step, but that did not work. Using the debugger, I can see that an Answer data entry is created in my database and my Collected_Answers custom state does add a new entry in the form of an answer. The problem is that the list of Answers in the Collected_Answers custom state are NOT being added to the Answers field in my Response data type (as seen in the last screenshot).

1 Like

Hello @etecle,

Thanks for reaching out.

We also saw your message via email and replied there. However, we see that you have already shared more details about your use-case here on forum. Feel free to continue our communication wherever it is more comfortable for you.

Here you mentioned “musician that is revealed and initialized on page load.” Could you please share how and where you used the “Initialize musician” action? In order for it to initialize correctly, please make sure you use it inside the “Musician revealed” event.

Also, regarding your use-case where you save an answer in the database during the “run workflow in each cell” action, we have tested it on our end on this test page, and it looks to be working well. Could you please check the page and trigger one of the buttons there to see how the information is saved in the database?

To better understand what went wrong in your case, could you please share a screenshot in step-by-step mode from the moment you start the page, trigger the button, and show us the problem you have and the desired output?

This will help us better understand your use-case and provide a better answer.

Thanks, and we look forward to your reply.

Best regards,
Support Team
Browse all Zeroqode Plugins for Bubble
Banner_Last3

Hi @ZeroqodeSupport - here is a screenshot of my initialization workflow, I had this set up already. The musician is also visible on page load by default.

Re: my use-case where I save an answer in the database when the “run workflow in each cell” action occurs, the answers are successfully saving to the database, but that isn’t the issue. The issue is in adding the “Answer” to the Collected_Answers custom state and having that “Answer” be stored in a “Response” data type (that has a list of Answers as a field).

If you look at the above picture, the Collected_Answers custom state is not adding the Answer that was stored in the database when the musician was triggered (when the Button Submit is clicked) to my Response data type

One thing I did discover is that if I set up two different buttons (see below) where one button solely triggers the musicians and one button solely creates Responses, my database is updated correctly in that Answers are created and then stored in the Response data type. However, I don’t want users having to click two buttons to save their Responses.


Hello @etecle,

Thanks for your message.

I have looked into your images and messages again. It looks like you are saving “answers” in an RG custom state during the “run into each action” event from the plugin, and then you want to save these answers along with other attributes in the database - is our understanding correct?

For this, please use the “create new response” action in the “Musicians finished event.” If you use it at the button click, it will be triggered at the beginning, and the responses will indeed not save as they will be empty. Also, for future reference, try using Bubble’s step-by-step feature to debug the page and see how the actions are triggering one after another. :pray:

Could you please try this on your app and let me know how it works for you?

Thanks, and looking forward to your reply.

Best regards,
Support Team
Browse all Zeroqode Plugins for Bubble
Banner_Last3

Hi @ZeroqodeSupport - it’s the other way around here. I’m saving “Answers” to the database and then I am adding those list of Answers in a custom state (that custom state is on the RG, that’s correct). I want to add a list of those Answers in the custom state to a different data type called “Responses”, which has a field “AnswersList” (the field is type list of Answers).

How should I be using the Musicians finished event here because I have three Musicians and one Maestro. I tried your recommendation, but I am getting three Responses being stored in my database this way rather than one Response, with multiple Answers within the Response.

I also did use the step-by-step debugger and logically, everything seems to be working correctly, so I’m still a bit stuck.

@etecle I have nothing against the plugin and I have personally used it before, but I’m not convinced you need the plugin to accomplish your goal.

What problem are you trying to solve that led you to this as the solution?

@bubble.trouble would love to hear your thoughts on why!

I originally wanted to use it because my understanding is that there are limitations on Repeating Groups. In my use case, users may have multiple questions or just one question that they can respond to and that can change on a weekly, monthly, or quarterly basis. So, in order to loop through those Repeating Groups and store the Answer in a Response data type, I thought I had to use a plugin like Orchestra.

Let me know if I can provide additional context.

@etecle Is the idea something like this?


(with the idea being that you can save both of these input fields with one click e.g. “Save Survey”)

@bubble.trouble yep, exactly - I’d add that in your example, the list of surveys would be automatically displayed on the page rather than via a dropdown, but that’s the general idea.

@etecle Well that makes sense why you were seeking out the Orchestra plugin. This is one of those things that Bubble makes you scratch your head and wonder why they don’t support this type of functionality in a repeating group by default. Maybe one day… (but don’t hold your breath).

Also, note that this is the way we choose to solve this particular problem in Bubble. We fully recognize that there are other options including the Orchestra plugin that work. This is (for us) the cleanest, most flexible and most reliable solution (auto-binding being one of the most common).

Disclaimers:

  1. The solution presented does not account for WU consumption, whatever those turn out to be in a specific app/implementation
  2. The solution is a bit of a hack which requires a few lines of JavaScript
  3. As a consequence of #2 you must use a plugin (Toolbox plugin)

If a picture is worth a 1,000 words than an editor is worth a lot more?
App: https://scott-test-app.bubbleapps.io/version-test/survey (username/password if it prompts)
Editor: scott-test-app | Bubble Editor

Step by Step Instructions:

  1. Install the Toolbox plugin (most apps should have this installed anyways)

  2. Enable the “Expose the option to add an ID attribute to HTML elements” option in your app under Settings → General

3a. Add a button in each “cell” of your repeating group. The workflow for this button will save your answer and is one of the key components of this approach. Later you will set the layout of the button to 1 px by 1px (making it unnoticeable in your layout). Note: It must be on the page as an element so setting it to “hidden” will not work.

3b. Set the id of the button like this:

Since the button is in a repeating group, it is going to generate a unique id for each Save Answer button (e.g. “btnAnswer-1”, “btnAnswer-2”, etc)

  1. Add a Save All Questions button on the page outside of the repeating group. The workflow will have one step (Run Javascript) as follows:

The script is as follows:

for(i=1;i<=properties.param1;i++) {
var btn = $('#btnAnswer-' + i).trigger('click'); 
}

Nearly everything in Bubble is based upon JavaScript which is super awesome. This little snippet of JavaScript simply triggers the “click” event of each button inside of the repeating group (notice the id matches the id we specified for the button).

Think of it as if the user clicked each “Save Answer” button on their own. This script simply does that for them “automagically” (and consequently runs all corresponding workflow(s) if their respective conditions are met).

Note: Don’t miss the important param1 specification which is the count of the questions in the repeating group.

  1. Modify the layout of your “Save Answer” button to 1px by 1px so that it is not visible to your end user.

Happy to answer any further questions about this technique. Please check the editor and the corresponding page above for any clarification.

Hello @etecle ,

Thank you for your message.

We also saw your message on email address with the details and replied over there. Also big thanks to @bubble.trouble for sharing his solution which can indeed also help with this use-case. :pray:

From your video and description, we understand that you have added three musician elements within a cell and are triggering the action to run inside the cell three times. Is that correct? If so, the “Musicians finished” event will indeed trigger three times for each loop you initiate, thus will save the response 3 times.

As you mentioned, you can use a state to save these values for future reference. Alternatively, you can implement a state to track whether the response has already been saved and then, you can add a condition to the “Musicians finished” event to handle this logic.

This workaround should ensure that the response is saved only once.

Hope this helps! If you have any other questions, please feel free to reach out.

Best regards,
Support Team
Browse all Zeroqode Plugins for Bubble
Banner_Last3

Thank you for the help @bubble.trouble and @ZeroqodeSupport! I tested both options and @bubble.trouble’s solution with the Javascript script was successful!

1 Like

Hello @etecle,

Thanks for your update.

Great to hear you managed to find a solution to your inquiry. Please feel free to reach out to us anytime you have a question or difficulty with any of our plugins—it’s always our pleasure to assist you.

Thank you, and we wish you a great week ahead!

Best regards,
Support Team
Browse all Zeroqode Plugins for Bubble
Banner_Last3