Append value to list


The image below shows some javascript which achieves what I wanted, however how do I append the value of a variable to an existing Bubble list please? Or is there a better way of doing this?

Thanks for your help.

Are you trying to do this in the script because there are also default add and add list actions.

Hi, there are no ‘add’ and ‘add list’ options that can be used within the script, that I can see, that’s what I was trying to do. The next step in the workflow does allow add list etc but I don’t think this works as the script is looping through the numbers. So, basically I’m not sure the javascript thing is possible, so might need to look at other options?

It might be easier if I explain what I’m trying to achieve, which is basically two lists in the database.

The following are inputs requested of the end user.

Current number of unit sales per month. Eg 10.

Expected no. of unit sales increase per month as a result of this project. Eg 15.

Length of project in months. Eg 36.

Month unit sales will increase. Eg 6.

I can create list 1, that’s not a problem. I am really struggling to create list2 hence the javascript. If anyone has a way of doing it another way then I’m more than happy to try it.

I have now tried this by using list of numbers after installing toolbox. I am still unable to work out the condition or workflow required to get the numbers to increase from the month requested, in the example below this is Month 6. Is anyone able to help me with this please?

It looks like you are doing the math ‘add’ and not adding items to a list field. In that case, an api workflow including 2 fields: month and sales with ‘only when’ on month or even a custom event on when month > 5 and <=36, make change to projection thing where sales = current sales input value + (month - last no growth month)*15

Hey @john6, did you work out a solution?

It looks like you have a list of numbers and want to use it with some changes to make another list of numbers.

You could use your javascript and send it to a Javascript To Bubble element, using it to start a new workflow, where the new list will be available, and from there save to the database field.

Hi Mishav,

Yes, that’s exactly what was done to make this work in the end. Thanks for your help.