Perform action on selected rows

Looking for some help on this topic.
I need to be able to select a number of rows and then perform an action to create a pdf.
The rows will be different every time so I cannot filter them in the template.
Is this possible? Users are taking screen shots at the moment which is not ideal. The fault description is a long text field so screenshot will not capture the full fault.

0 25 2,883
25 REPLIES 25

If you need to have these records in the same PDF you could create a separate form where your users can select records to be added. Then you can use that record for filtering the Start: & End in the template.

Not sure I understand how that would work. Is the feature to apply an action to selected rows something that is being looked at?

Using multi-select, you can apply an action to each of the selected rows individually, but you cannot apply an action to all of the selected rows at once.

@Aleksiโ€™s suggestion is a good one.

thanks, it would be really, really useful to be able to apply an action to selected rows. Its difficult to apply individually if you have lots of rows. Really need this feature also so I can select all rows and reset the value of a column to zero after email with pdf is sent.

What you are asking CAN be done with AppSheet currently. Just not directly as in โ€œselect these rows and then create a PDF from them right nowโ€.

Selection is nothing more than an indicator that the row is selected. You can do this by adding a column named, say, โ€œSelected?โ€

Then there are two things that need to be worked out

  1. How are the rows marked selected? By user, by some data change or both.
  2. When does the PDF get created? Automatically or by user request? If automatically, then how does the system decide its time to generate the PDF?

Once you have this worked out then it is just a matter of the PDF template getting the list of rows that are marked โ€œSelected?โ€ and producing the report.

There are details that need to be considered but your specific use case will help guide those details.

There is a challenge with this method if two or more users are requesting the pdf at the same time. Thatโ€™s why I didnโ€™t propose it.

Oh right @Aleksi, I see what you mean. So if user A select rows 1 and 3 that they want to pdf but if User 2 selects rows 2 and 4 before user A hits the action button then all 4 rows will be on pdf.

I had another similar issue. I have a table of products (thousands of products). We have a construction site with several Blocks, A,B,Cโ€ฆ I created a table with columns Product, Quantity. I want each block manager to enter the quantity of each product that he needs and then send a pdf. I had to create an App for each Block and give permission to only one user to use. I know I could have put into one App and give permissions to logged in user to each table. Issue is that Block A manager who has exclusive use of his table, may put quantities against a lot of products on Floor 1. Once pdf is sent he needs to reset each row to zero individually so it he is ready to start again for Floor 2- done at a later date. Not sure what the solution is to this.

Martina,

It sounds like you may be describing what is essentially an order entry system.
If so, this is typically implemented by creating an Order record that represents the Order and OrderDetail child records for each product in the Order.

The Order record contains:

  1. An OrderId field containing a UNIQUEID to identify the Order record.
  2. An OrderDate field indicating when the Order was created.
  3. A Ref field to the โ€œCustomerโ€ or in your case the Block Manager.
  4. An OrderStatus enum field to track the status of the order.

Each OrderDetail record contains:

  1. An OrderDetailId field containing a UNIQUEID to identify the OrderDetail record.
  2. A Ref to the parent Order record.
  3. A Ref to the Product record being ordered.
  4. A Qty reflecting the quantity of the product being ordered.

The virtue of such a design are many.

  1. It is a well known pattern that is proven to work.
  2. It provides a permanent record of all Orders.
  3. It makes it possible to โ€œtrackโ€ the status of each order by updating the โ€œStatusโ€ field in the Order record.
  4. There are no concurrency problems because every Order is independent.
  5. Your PDF reports can extract data from the Order, OrderDetail, Product, and BlockManager records that are linked to the Order via Ref fields.

Hi Philip,

I have actually created an ordering system. Our system is pretty complicated. The Block manages Pdfโ€™s will feed into the Ordering system once approved. We do bulk ordering of items and draw off from that order as and when needed so items are not sitting on
site before they are needed taking up space or get lost or stolen. A simple example would be if we had 300 apartments, we would place an order with a supplier for 300 baths, 300 toilets and 300 sinks. 10 of each may be needed each week. The ordering system
has to deal with the draw offs and deliveries to site.

We use the Block managers pdfโ€™s for more complicated products such as lengths of pipe or high spec items.

Regards

Martina Hawkins

Business Systems Manager

**Kind Regards

2X_6_6b6fcaff1e7cad948b21780e9d092a7a6c250899.png

@Aleksi @Steve @Phil

@Martina I apologize if I added confusion. I was not trying to contradict any other comments. I was reacting to your statement and trying to point out that AppSheet has great flexibility to create your own solution IF what was suggested or currently provided in AppSheet is not sufficient.


To back up to your original post, if your goal is to simply allow a user to select a set of rows and produce a PDF report from them, then @Aleksi initial solution is perfect!!

However, you added later in the thread that you also wanted to โ€œreset the value of the column to zeroโ€ after the PDF is sent. If by business process, two users would NEVER overlap their row selections, then @Aleksi solution is STILL the perfect choice AND you can include that automatic reset of the rows in the Workflow.

BUTโ€ฆif two users COULD select the same row, the implication is that you either need to:

  1. have the row available for ALL PDF reports being created at that time (i.e. no reset)
    OR
  2. you only allow that row on a single report.

What I posted was a general idea responding to this implication and then made the statement below to acknowledge that youโ€™ll need to adjust for your specific circumstances.

For example, you mentioned the problem with two users trying to report at the same time. You can combat that by not only having a โ€œSelected?โ€ column but also a โ€œWho Selectedโ€ column. The benefit being that the row can only be selected by one user at a time. Last one to select wins and gets the row on their report!

The assumption always being that a row reset is performed after the report (or reports) have completed.


Bottom line, AppSheet is flexible enough that there is ALMOST ALWAYS a way to create your own custom solution to resolve an issue.

At the end of the day, the job of us developers is to save the users time and headaches with software improvements and sometimes we have to get creative to overcome obstacles!!

If you still need help with resolving your issue, please donโ€™t hesitate to continue posting your queries

Good Luck!

Iโ€™m still struggling with this issue and its coming up in more than 1 instance.
It would be a simple filter and copy and paste (or drag) action in an Excel Spreadsheet or a simple macro.


I could have 200 products here. I only see the action when I select one row. I canโ€™t have the user clicking every single row.
I understand the issue of multiple users but I canโ€™t figure out a work around.
Another similar issue:
I have say 100 products in a view with a required date of say 22/12/19. I want to set the ETA = Required date (which then adds the row to the delivery calendar) OR enter an ETA somewhere and apply this ETA to all 100 rows automatically.

Can you post an image of the Action Definition you are trying to get working?

the action works on a single row

What is the โ€œOnly if this is trueโ€ property set to?

2X_e_e98ce1184175a4a537f1d436c816ce1ffa18553f.jpeg

First, did you expand the Action Menu to see if the Action was in there? This is the 3 dots in the upper right hand corner AFTER you have selected multiple rows?

Second, I donโ€™t think your FILTER() is correct, it should probably be [quantity] <> 0??

And Actually, For Bulk Actions you donโ€™t need the two Actions IF you are trying to apply the Action to ONLY the selected rows. AppSheet will automatically take your selected rows and apply the Action to each of them.

So, You have two options:

  1. You can use the setup you have (with the Filter fix) and choose only 1 row and then it will (should) select ALL the rows where quantity is NOT zero and send them to the second Action to reset them to zero

OR

  1. Get rid of the first Action and setup the second Action as the one attached to the rows. Then all you need to do to utilize it is select the rows you want to set to zero in the view by checking them and then select your Action.

I hope thatโ€™s all clear. Please ask if you need to.

  • yes, action is there
  • yes, filter is wrong, changed to <>0
  • Option 1 does not work, it just sets selected row to 0
  • option 2 does work but that is what I need to avoid. I cannot select 200+ rows

Oh, one other thing I forgot to mention. Also in the FILTER() statement the table name should be in quotes so it should look like this:

FILTER("takeoff test", [quantity] <> 0)

Try that to see if the filter properly selects the rows.

I am not sure why the Action is not being shown when more than one row is selected. And if it is the case the filter didnโ€™t work because the table name wasnโ€™t quoted, I donโ€™t know why the action would have been applied to just the selected row? I am going to setup a little tester app to get more clarity around this.

thanks for your help John. Changed filter but it still doesnโ€™t work.
The Action does show when more than 1 row is selected, just canโ€™t manually select all rows.
I donโ€™t really need a filter, I just need to Select All rows and change quantity to zero, doesnโ€™t matter what current value of quantity is.

Hi @Martina,

You may wish to consider following if I have properly unserstood your requirement.

From the images shared by you, it sounds that you are executing a reference action on the same table that is โ€œTakeOff Testโ€. Your parent table and reference table seem to be one and the same. As per my understanding โ€œReference actions are used to modify a row ( or more precisely rows) in one table via an action defined on another table.โ€

So you may define a one column one row parent table and you may use that table to edit rows in bulk in the child table ( โ€œTakeOff Testโ€)

I request you to take a look at the sample app mentioned below. I believe it is an app that is very similar to your requirement. In this sample app , all the [Number] column values in the child table are incremented by 1 by an action on parent. I believe you need all the rows the [quantity] to be set to zero. I have tested as per your requirement as well. (Setting values to zero by one click action on parent )

We need to define parent /child referencing in such a way that whenever you add a child record , it invariably references the one and only row in the parentโ€ฆ So in the child tableโ€™s reference column we define key of the one and only row of parent as initial value.

https://www.appsheet.com/samples/This-app-shows-how-to-use-reference-actions?appGuidString=e76d2e73-...

I had used above concept to delete rows in excess of 100 in child table. One observation is it will take a while to delete, if one has large number of rows to delete because there willl those many individual actions invoked on child table ( 100 actions for 100 rows)

Hope this helps

@Martina I played with a sample app doing the same thing as you described. I created a video to demonstrate the results. In short, I had no issues in getting values to reset to zeroโ€ฆmaybe I missed something?

Thank you so much John. Its evening time here now in Northern Ireland so I will look at it in more detail in the morning.

Regards

Martina Hawkins

Business Systems Manager

**Kind Regards

2X_6_6b6fcaff1e7cad948b21780e9d092a7a6c250899.png

John, I couldnโ€™t wait till the morning because it was bugging me so much. I watched your video and checked that everything was exactly the same and then tested it and it worked!!
I really do not know how this happened as I didnโ€™t change anything.
Thank you for all your time, this is so great to get this working.

Awesome and your welcome!! Glad its working. Have a good evening!!

Top Labels in this Space