Change values in multiple rows with action

Hi,

So my app is an engineer jobsheet app where engineers fill out job sheets etc.

I create the Job and assign it to an engineer in the form which is all fine and well.

I am looking for a way to bulk assign jobs to an engineer in the engineer tab.

Example: Click Engineer, Click assign jobs button, New Screen, Select Jobs to assign from a dropdown, click assign button, through a relation it finds all the jobs selected and changes the Assigned to Column to the selected engineer.

I have done all of this and it works well, but only for 1 job selected… When you select multiple jobs it doesnt change the Assigned To column for any of the jobs. Is there a workaround for this?

Thanks,

Matty

What you could do set is up a custom action on the engineer list that will first write the selected engineer to a column in the user profile table through a single relation to that user profile row. Then show the details screen for the engineer. Then instead of a choice component to select jobs, you could show an inline list of jobs. Then change the action on the job list to write the engineer from the user profile to the assigned column.

I would probably filter your job list to only show unassigned jobs as well as jobs assigned to that particular engineer. Also, I would make it a custom action with an IF condition to check if the engineer is assigned or not. If one is not set, then set it, else clear the assigned column.

1 Like

I have made progress with the method I wanted, the dropdown box to select the jobs to assign!

I have done this by creating a new sheet: Bulk Assign.

In here, I have the following columns:

  • List of Jobs to assign (This is a joined list to get the info from the selected jobs from the user tab)
  • Job Numbers to Assign (Split List of the above Joined List)
  • Amount of Jobs (This is a rollup of the number of jobs selected)
  • Max to assign (This is a math column that is (Amount of Jobs - 1 (To account for Row 1 being Row 0))
  • Job Switcher (This is a number column that is default at 0)
  • Single Job to Assign (This is a single value that gets the Nth value of “Job Numbers to Assign” where n = Job Switcher) so for the jobswitcher , 0 = first value, 1 = second value and so on.

Obviously the relevant Relations/lookup columns are now in my User Tab to go with this.

Once I select the jobs from the dropdown, I can then press the button.

The Action for the button Sets the Job Switcher to 0, and then Sets “Assigned To” in the Job Tab for the first Value of the dropdown to the Selected User. It then Increments Job Switcher by 1 and Sets “Assigned To” in the Job Tab for the second value of the dropdown to the Selected User. And So on…

However, the issue I am facing now is my app doesnt know how many times to increase the switcher and Set Assigned to. Which is why I created the Max to Assign column. But I have no idea how to encorporate the Max to Assign value to make sure it only increases and assigns the correct number of times.
Any Ideas?

Hope this made sense.

Thanks,

Matt

One solution I thought of would be to have a condition for the Action…

If number of jobs to assign = 1, then increment once
If number of jobs to assign = 2, then increment twice

but there may be times where I am assigning a lot of jobs at once so wouldnt be the right solution

It would be good to have a condition inbetween actions in the flow… so after each increment and assign I could Check if current switcher value <= Max.

Does it have to be with a multiple-choice component though? I would still choose the way Jeff proposed, to have an inline list and assign the user you’re “viewing” to that job. That would make the data structure easier to handle in my opinion.

1 Like

Yes I’d much prefer the multiple-choice method.

I have managed to get it to work the way I want it with the multiple-choice but have limited the amount of choices to 10. The action button checks if the number of selected jobs is 1, then assigns that 1 job, if its 2, it assigns the first, increments the job switcher and assigns the second… and so on… up to 10. Very time consuming to create but its done now and works a charm.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.