Create multiple records, apply decision logic and generate an email with a CSV attachment

Hi,
I’m new in Bubble and evaluating the product through a prototype application. The application allows a requester (say a manager) to select business roles for her direct reports and in the end has to send an email to someone else with an “action list” that requests the assignment or the removal of a series of assets (like computers, software, etc.) based on the role changes requested.

The MAP between roles and assets is kept in a table, and the requester does not need to see that.

I already built the screens to capture the initial REQUEST (a thing that’s like an Order) and the desired changes in roles (like the Products in the line items of an Order).

I need the application to perform 3 steps:

  1. create a list of assets to add (remove) based on the roles assignments (or removals) requested in the Order, based on the Roles to Asset Map table. Following my “purchase order” equivalent, this would be equivalent to the assembly parts required by each Product in each line item or the Order. I believe the way to do this is to Schedule a workflow API on a List. I have two problems here: one is that the list cannot have more than 50 items and the other is that the user can request more than one role change at once. (e.g. remove Role A and add Role B) The way I see it is that a workflow API on a list (of Roles) will have to invoke another workflow API ( to map Role to assets). If someone has a better idea, please don’t be shy and share it!!! In the meantime, I’ll play with that to see how to do it.

In the meantime,

Question 1: Since I have many roles that require more than 50 assets, is there any way of processing that list in steps (1-50; 51-100; etc.?) I think that there won’t be roles that need more than 100, so I’d be OK with hardcoding 2 actions only. But I don’t know how to select the first 50 items in action 1 and the remaining in action 2. Any suggestions there would be much appreciated.

  1. Apply some logic to create the Action List. I built this in JS before and effectively, I needed arrays, for loops nested in for loops and if/then/else conditions. This is because the action list is slightly different from the list of assets attached to the requested role. For example, if the request is to remove a role, and there is a computer assigned to that role, the action list should not request the removal of the computer until the last role that needs it is removed. I also need to enrich the Action List with information about the Asset that the people provisioning it will require (e.g. instructions on how to provision it).
    Question 2: How do I apply “more sophisticated logic” in a bubble workflow? I haven’t seen constructs that allow nested for loops (or a single for loop, or an if/then/else for that matter) in the workflow.

  2. Convert the Action List to a CSV file, and send an email with that CSV, either as a real attachment or as a link that would download the file when the recipient clicks on it. I have no option on this part. I need to send them the info this way.
    Question 3: I haven’t had time to look into this part yet, so I don’t know if that’s even possible. Is it possible? If so, how?

Any help will be much appreciated!

Alex

There is a lot going on in that post. You should really break it down into multiple threads of each distinct problem, otherwise the responses will be all mixed up and all over the place.

You should edit the one above, and limit it to just the processing multiitems/ lists. and then subsequent posts for the other areas of query,

Thank you Dave. I don’t know what I was thinking when I posted my life story.
(Actually since I managed to answer a bit of my own questions, I was doing exactly what you suggested: breaking it down into more manageable problems when I received your note. )

You’ll see 3-4 new one :slight_smile:

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.