Action to duplicate specific row

Hi there,

I’m new to using Glide, but currently building my first app. I’ve run into a challenge, which I hope you can help me solve!

Short description: When I add one row with data, I want an identical row of data to be added to the sheet, with some adjustments (i.e. change a date in one column).

Long description: I am building a service inspection report app, where a technician should be able to enter data for a completed service. Currently, each services corresponds to one row in the sheet. I have a column called ‘stage of service’ and would like to add a button/action, which creates a duplicate row with the same data for Service X, when that row has been marked as ‘Completed’. This new duplicate row would then be an ‘Upcoming’ service, which will be put in the calendar for the next inspection.

Let me know if it is necessary to elaborate on the above!

Thanks,

H


An image to explain. When row 10 is being added by the user, I want to automatically add row 11 (only information changing should be date of service).

First of all, make a new math column calculating the new date based in current date.

Then, you can make a conditional button in every entry in collection based on status of service (if stage is complete then show).

Add “add row” action to the button, then past any data of current row to the new one, including the new date.

Now you have the new row added.

2 Likes

Thanks for the quick reply!

I think I understand most of your points, however, how would I automatically ‘Paste any data of current row to the new one, including the new date’?

This is specifically the challenge that I have. When I add an ‘add row’ action button, it just takes the data from the first row in the datasheet and not the specific row which the user has just added (e.g. row 10 in my snip above).

You need add the button to the collection items, that way the “add row” will take the data from that specific item/row

Screenshot 2023-11-14 at 9.16.11 AM

1 Like

Thanks, I think that works - it’s not automatic though.

I would have liked that when a user ‘Adds a row’ (i.e. row 10 in my picture), there would be an option within the ‘add row’-form to add a duplicate row which would then be the follow-up service. Now, the user would need to add a completed service and then subsequently locate that service in the list and press ‘Add follow-up service’.

I would have liked a button here, that duplicates the row with the ‘date of next service’ defining the row 11 ‘date of service’:

Of curse, what you need is called “On Submit” action, you can found it in General on that same from screen, just add “Add row” action. Remember the Date has to be the newDate math column calculate.

But, it will make the row automatically and no just when stage is “Completed”, as the form will create two new forms with “Incomplete” stages.

2 Likes

Thanks, @Elmerdubon!

That seems to do the trick - now an additional row is automatically added on submission. Only ‘challenge’ that I am left with is the User Experience when pressing Submit and they don’t get a ‘Success’-notification.

Any way to add two ‘On submit’ actions, so I can both have an ‘Add row’ as you suggest and a ‘Show notification’?

Thanks again, really helpful!

Create a single custom action that does both.

2 Likes

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