Changing row ownership of multiple rows through action button

Hello Gliders!

I have a table which has multiple rows where each row is representing a sales lead being pursued by a sales agent. Each row has has multiple columns related to details of the sale lead and is tied to the sales agent who is managing it (by making the agent e-mail as row owner). There are multiple agents, each would have their own set of rows that increase each day as they add new leads(every new load info they provide in the app for their lead via a in app form, adds a new row to this table and can be viewed only by them). It all works well uptill now.
Now if an agent leaves the company, then i need to move all their leads to somebody else. My current way(which is tedious and not at all scalable) is that i (manager who can see all leads of all agents) can reassign each lead to a new agent of my choice by filling a form via an action button. I basically goto the lead, and via an action button open a form that keeps all details of the lead the same except for the agent name and e-mail, which i can select, thereby ā€˜reassigning’ the lead to an agent of my choice. Clearly this will not be very efficient if i have to reassign 100 leads at once. So what i need is : Via an action button + workflow combo (maybe) i can just select the name of current agent, which then selects all relevant rows of that agent and then select the name of the new agent, which then replaces the name and agent e-mail for those rows, thereby reassinging the lead to the new agent. Hence all the leads of the current agent get transferred to the new agent.
@NoCodeAndy @Darren_Murphy Please guide
Thanks
AK

You could do that with a Manual Trigger workflow. Pass two parameters to the workflow: ā€œemail fromā€ and ā€œemail toā€. Then setup a loop on the table, filtering by ā€œemail fromā€. And inside the loop, use a Set Column Values node to change the row owner to the ā€œemail toā€.

1 Like

Sorry for my ignorance but how exactly do you set up a ā€˜loop on the table’?
My current understanding :-

  1. Create an action button on the app page labelled ā€œReassign leadsā€ which on clicking opens up a choice form where i can select ā€œe-mail fromā€ and ā€œe-mail toā€.
    Lost after this.

You need a Button that can trigger an action.
The action to use is Trigger Workflow.
That should call the workflow that I described earlier, which you need to create separately.

Yes the first two points i understood. The workflow is where i’m confused.
I’ve selected the app interaction workflow type.
Selected my table as data source.
I’m stuck here. How do i create the loop ?

No. You need to use Manual Trigger.

1 Like

@Darren_Murphy
So i selected the manual trigger. Added 4 items to it viz. current agent name, current agent e-mail, reassigned agent name, reassigned agent e-mail. Then added an action ā€œloopā€. Selected the data table (ā€œall leads tableā€)that needs the rows changed. Applied the filter there based on ā€œcurrent agent nameā€ or ā€œcurrent agent e-mailā€. Then added the ā€œset column valueā€ action. In that i assigned values for each column for each row, where for each row all columns values remain the same as before except for the agent name(replaced by reassgined agent name) and agent e-mail(replaced by reassinged agent e-mail).
Parallely, i’ve made an action button on the app page which on clicking opens up a form where user can feed in current agent name and e-mail and reassigned agent’s name and e-mail.
But where do these 4 parameters go from this form? Do i need to make a new table to collect his data and then connect that to the workflow somehow? Basically how to connect the app user’s input of these 4 parameters into my workflow

Thank you so much for helping me out!

When the form is submitted, you need a Trigger Workflow action. Select the Manual Trigger workflow that you created, and it should prompt for the parameters.

So when i make the form i need to define a destination. The destination for the 4 details i’m feeding it are for the manual workflow and not for the ā€œall leads tableā€ so what should be the destination for the data of the form ?
I guess what i’m trying to ask is that do i even need to build a form that takes these details upon clicking an action button since the destination for those details cannot be the the table, that data is purely meant for the workflow to use.
Like should i just create an action button that upon clicking runs the manual workflow(and that it would prompt me for those 4 parameters?)

The form in this case isn’t really needed.
I would just use a details screen with a couple of choice components that write to user specific columns. Then add a ā€œSubmitā€ button that calls the Trigger Workflow action, and passes the values from the user specific columns.

I’m sorry but i still don’t get it. I need to pass the 4 values : Current agent name and e-mail and reassigned agent name and e-mail to the workflow.
My data table ā€œall leads tableā€ has columns named ā€œagent nameā€ and ā€œagent e-mailā€ which are row owner columns.
There are no columns named ā€œcurrent agent nameā€ or ā€œreassinged agent e-mailā€.
Even when i create the action to trigger the workflow, it opens up the 4 parameters but the data in those 4 parameters needs to be from some table right? Like the submit button thing you said, those 4 parameter names exclusively are made for the workflow, so how do i give them custom user input values because the 4 dots next to each parameter (when defining the workflow action) open up the columns of the ā€˜some table’, it doesn’t give me any option to take the 4 parameter values from a form or anyother place.
Maybe i’m being too dumb here or maybe i’m not able to convey my point exactly.
Attaching some screenshots. The one marked with green question mark is where i’m stuck. Those are the 4 parameters that were declared in the workflow, how do i populate them from a non table source? The 4 dots next to them open up options from some table atleast, it can’t be open ended. I hope it clears my issue here now.

Thanks


Easier if I show you, I think.

https://www.loom.com/share/afd9d066582647528fc95e392de0deff

1 Like

This was amazing Darren! Thank you. Thank you. Thank you. :folded_hands: