Perform Action When User Taps Record in Table List

I would like to perform the following action/behavior, and I’m not sure if it’s possible or how to do it. I read all about actions and behaviors and played around, but couldn’t figure it out.

When a user clicks a record in a table list, I want to pop up a screen to say “Start Install?” and if the answer is yes, log the current time into the “Start Time” field. If No, continue on to view the data.

I saw in the list of Actions that you can send the user to another view; perhaps I could try to accomplish something similar that way. How do I tell AppSheet to perform an action if the user taps a record in a table list with Status = “Red”?

Solved Solved
1 27 1,139
1 ACCEPTED SOLUTION

That’s what I was looking for! Thanks! Now I want to challenge you to implement a Record Time 2 action using: (a) a Grouped: execute a sequence of actions; and (b) two Data: set the values of some columns in this row actions. Then consider how this might allow you the behavior you want.

View solution in original post

27 REPLIES 27

Steve
Participant V

Thanks! I was able to get this to work - i.e., record the start time when a user selects a record, but I’m not sure how to tell the app to only trigger the action if the status is “red”. Also, for the confirmation, where do I put the “No” path. I want the user to proceed to the record if “No” is selected. Right now, the app leaves me at the list.

Thanks Steve. Right as you responded, I figured it out. Duh!

I added the logic and it works; however, if I click on a record with “green” status, I don’t proceed to the record. It just hangs. Also, how do I specify the “No” path. Shouldn’t it take me into the record?

Nope. The default action if you don’t specify one is effectively an action of type App: go to another view within this app with a Target of LINKTOVIEW([_THISROW], "Tasks_Detail"). In setting a Row selected action, you replace the default action with your own.

I’m so close! I put everything in (and think I understand it too :)), but I receive an error when the Tasks Detail view loads. If I take out the actions, the view loads fine, so I’m not sure what’s tripping it up. I’ve tried several things, but no go. Any ideas?



Eek! My bad! LINKTOVIEW should be LINKTOROW: LINKTOROW([_THISROW], "Tasks_Detail").

I should have been able to figure that out! Next time. When I make this change everything works EXCEPT when I select No to the confirmation, it does not take me into the details, but leaves me at the screen. If the user says No to record start time, that means they want to edit the record, so how do I see go to details if confirmation is no? I really appreciate it. Thank you.

Hmmm… You may have to approach this a different way: you could attach the set-start-time action to a column by setting the actions’s Prominence to Display inline. Then add the column to the table. The action button will occur in place of the column in the table display.

Whoa! That worked. Impressive. Thank you Steve.

Steve - I can’t tell you how ecstatic I am that this works! Hah! I have another question though. I created another action to record End Time. It’s set up the exact same way - prominence inline. The popup appears as with the Start Time, but of course the End Time only appears for records with status=yellow meaning in progress. See below - why don’t the icons line up?


The buttons are tied to columns, two columns. Both columns occur in the table even if the button they contain doesn’t for any given row. That empty space is where the other button would be were it displayed for that row.

Consider using different icons for the two actions to make it clearer which is which.

There are other display alternatives, but they’re a bit more complex.

Maybe I could do a “Record Time” action and have it conditionally set either start or end time based on whether status is red or yellow. If that’s even possible. It would be the same icon, but I prefer that over the misalignment.

Nice! And do-able, indeed. Lemme know if you need any help.

I guess the problem is what column to display. I need a new column to display the icon and then set either Start Time or End Time based on that.

That’s what I’d do.

Ok, so I believe I have that working beautifully. NOW, is there any way to alter the confirmation message conditionally based on whether status is red or yellow?

I don’t think so. What do you have so far?

Here’s what I have so far. Upon entering app, select Building, then Floor. Table list is sorted by Area. Pending, Complete, In progress statuses appear (red, green, yellow respectively). If you select the icon, a popup appears - “Record Start or End Time” which is the best I could do. If the status is yellow, the End Time is recorded. If the Status is Red, the Start Time is recorded. Once the Start or End time is recorded, the status changes appropriately. Screen shots below. The icon was tapped for the first beacon under “Room 1002”, answered “Yes” to popup, and then status changed to yellow.

I would like to have a tailored message on the popup, but not sure that’s possible.


2X_6_636e6fba514c8083daa23ed0fa8d3efdd03c1033.png
2X_0_08e2ecdc66ddbebda4bb5e3e9d1d857b0c0b79c9.png
2X_9_91760b0ef908610687af048094193e23c12c67b1.png

Could you provide some implementation details?

Sure. We’ll probably start out with about 10 techs or so for (1) property to test and get feedback on the app. We’ll deploy the app by sharing with the techs who will be performing the installations. Is that what you mean?

No, sorry. I’m not being clear. How did you configure your app to know when and how to set the start time, and then how an when for the end time? You used actions? What type? What expressions are involved? I suspect there’s a way to tweak what you have to give you the specific popup text.

Ah, ok. So a tech when they begin the job (installation of a beacon, aggregator, or gateway), he should go into the appropriate task and click the icon to record the start time. When the icon is clicked, the popup appears and if the tech answers yes, the current time is recorded in the Start Time or End Time field (type TIME). Whether the time is recorded in Start Time or End Time is based on the status of the task when the tech taps it. If the status is red, then Start Time is updated, and the status is automatically changed to Yellow. If the status is Yellow, the system knows that a Start Time has already been recorded, so the current time is recorded in End Time and the status is automatically updated to Red. I used an inline action (“Record Time”) to record either start or end time. I would like to have the confirmation popup say “Record Start Time?” or “Record End Time” based on whether the status is red or yellow. I hope that made sense. See images.





That’s what I was looking for! Thanks! Now I want to challenge you to implement a Record Time 2 action using: (a) a Grouped: execute a sequence of actions; and (b) two Data: set the values of some columns in this row actions. Then consider how this might allow you the behavior you want.

I figured it out. Thank you for challenging me! That’s pretty slick.

Create an action of type App: go to another view within this app with a Target of LINKTOVIEW([_THISROW], "Tasks_Detail").

Create an action of type Grouped: execute a sequence of actions, add the set-start-time action as the first action and the navigate-to-details action the second.

Set the Row selected event action to the group action.

I see your response. Let me try this. Didn’t see it when I responded earlier. Thanks!

Top Labels in this Space