Selecting & running a backend api from dropdown list

I have a set of backend api’s (each one triggers a dynamic email via Sendgrid).

In my dashboard, I have a repeating group with my customers. I want to select one of the backend APIs from a dropdown list and apply it to the customer (to trigger the bespoke email),

I’m not wedded to the dropdown, but damned if I can find a way to do this.

Any help much appreciated!

Thanks,
Steve.

I can understand what you said about using the dropdown, @stevoster. But I would use the same approach with the dropdown as well.

Hi Tonare - my question is really this - how can I use a dropdown for this?

Thanks,
Steve.

Using the ‘When value is changed’ event of the dropdown.

In the solution below, I have a single dropdown that will be used for the entire repeating group. You select the users on whom you want to perform this action and then choose the option from the dropdown.

Once you do that, you will see an alert on the screen informing you that action X will be executed on Y users (just so you can see that the event has been captured). In a real scenario, instead of showing the alert, you would execute the desired action.

Don’t get caught up in the UI/UX details of the page. It was created quickly just to give you an idea of how it can be done.

Hi Tonare - thanks for the example and the explanation. That would solve for selecting a user to run a single API, the issue I have is that I have already selected the user, I want to be able to select which API to apply to that user, via the dropdown. So the dropdown would show me a list of APIs. I can think of a very long way around it (create a list of the API names, select from that list in teh dropdown, and then a very long-winded workflow containing many “When dropdown value is x, run api(y) on current cells user” type of arguments. I’m hoping there is another more efficient way, but maybe not.

Yes, but you can simplify it by labelling standardising each backend workflow by a number or slug, and using custom events on the front-end of your dashboard to then trigger the backend filtering from the dropdown.

Hey! Thanks - would you mind expanding on that a little more if you could? I think what you are saying is there is a way to create a ‘thing’ called, say, ‘APICalls’ which contains my API workflow name and a corresponding number, and that number calls the relevant API when it is selected in the dropdown? But how do I do this sort of lookup in the custom event? Or have I totally misinterpreted? Thanks!

Of course,

To be practical, you can create option sets with each of the dropdown options, assign each one of them a number.

Fill the dropdown with data from your options set, now the trick is to create duplicate conditionals on click for your button, separate them by the number on each one of the data sets on the dropdown. From there you can trigger Api by Api.