How to add a checkbox to a table view

The question of how to add a checkbox to a table view has come up before:

The answer (attaching an action to a blank virtual column) was provided but as I donโ€™t think the implementation is completely self evident, I thought Iโ€™d provide a little example and explain the steps one needs to follow to implement it.

First, hereโ€™s an image to illustrate the goal:

2X_4_4d96599ece1a9f359cfe793165b305c03db90da7.png

The empty checkbox and the checked checkbox are the same action. When the action is invoked it changes a column called โ€œCheckโ€ from either โ€œFALSEโ€ to โ€œTRUEโ€ or โ€œTRUEโ€ to โ€œFALSEโ€.

The action uses the following expression:

if([Check]=TRUE,FALSE,TRUE)

It has been attached the an empty text column (a virtual column). In this case, I called the column โ€œBlankโ€ but the name could be anything because the name of the column will not be shown in the table.

Next, attach the action to the blank column as follows:

To get the action to appear to be an empty checkbox when the column โ€œCheckโ€ is โ€œFALSEโ€ or blank, choose the following icon for the action:

2X_0_0dcba41f76dd92f6cb2a8919b41b271d8b42fbef.png

Now, go to UX โ†’ Format rules and make the following format rule:

This way, when the action does itโ€™s work and changes the โ€œCheckโ€ column value to โ€œTRUEโ€, the icon will change to a box with a check in it. It will revert back to an empty box (and the โ€œCheckโ€ column value will go to โ€œFALSEโ€) if you tap on the action again.

Now, how do we place the action within the table? Hereโ€™s the column view for the table view (UX โ†’ Views):

This places the check after the โ€œNameโ€ column. If the โ€œBlankโ€ column is placed after the โ€œNumberโ€ column, it will look like this:

2X_7_77678791af0e80e3091f97e74b4371762c165e1d.png

Well, thatโ€™s about it. The only thing I couldnโ€™t figure out how to do is to give the blank action column a header. The action will โ€œattach,โ€ in a sense, to the column that precedes it but I canโ€™t figure out any way to avoid having blank space in the header position above the action.

P.S. This is one of several tips I have put together about how to work with table view. Hereโ€™s a link to the rest:

23 15 17.4K
15 REPLIES 15

Awesome @Kirk_Masden Thank you very much.
I think your column [Blank] is of Type Yes/No ?

Thanks for your support and encouragement, @Fabian! To be honest, Iโ€™m having trouble remembering how I set that column and I seem to have erased this little test app.

In another app of mine (the main one I have been working on for some time), I make it a โ€œThumbnailโ€ virtual column that displays images based on the combination of two checkboxes as follows:

2X_f_f8db40d1bf747ee749e7db15fbc13836a9f990aa.png

This is accomplished with the following expression:

ifs(
and([Cram]=TRUE,[Cram only]=TRUE),
โ€œhttp://www2.kumagaku.ac.jp/teacher/~masden/2017/ICS/cram/Cram01a.pngโ€,
[Cram]=TRUE,
โ€œhttp://www2.kumagaku.ac.jp/teacher/~masden/2017/ICS/cram/Cram02a.pngโ€,
[Cram only]=TRUE,
โ€œhttp://www2.kumagaku.ac.jp/teacher/~masden/2017/ICS/cram/Cram03a.pngโ€,
1=1,โ€œhttp://www2.kumagaku.ac.jp/teacher/~masden/2017/ICS/cram/Cram%20thumbnail%20blank.pngโ€)

Iโ€™m not sure if I did this the right way, but the last โ€œ1=1โ€ means that if none of the other IFS are true than use the transparent blank thumbnail.

I havenโ€™t checked but I think the column to which the checkmarks are attached can be almost any kind of column.

1=1 is really a cool idea . I didnโ€™t know that this would work.
I think you could wrap it also in an If statement like:

if(
and([Cram]=TRUE,[Cram only]=TRUE),
โ€œhttp://www2.kumagaku.ac.jp/teacher/~masden/2017/ICS/cram/Cram01a.pngโ€,
ifs(
[Cram]=TRUE,
โ€œhttp://www2.kumagaku.ac.jp/teacher/~masden/2017/ICS/cram/Cram02a.pngโ€,
[Cram only]=TRUE,
โ€œhttp://www2.kumagaku.ac.jp/teacher/~masden/2017/ICS/cram/Cram03a.pngโ€),
โ€œhttp://www2.kumagaku.ac.jp/teacher/~masden/2017/ICS/cram/Cram%20thumbnail%20blank.pngโ€)

In this case you say: take the blank thumbnail as the ELSE.

Now I will explain how to use check boxes in Table view.
Thanks for the explanation @Kirk_Masden, I tried the way and I got it successful.

My excel has columns Name No and Check, make Check as Yes/No

Goto Behaviour and click on Add New Action

set the column to Check and provide formula if([Check]=TRUE,FALSE,TRUE)

In appearance make action icon to square and make prominence as Display Inline

Now click Attach To Column and provide our column Check and as you can see we got a check box

Now goto UX -> Format Rules and create new format rule

in formula tab write [Check] = TRUE
next provide our newly created action to it
for icon use check-square

we can check and un check now

App Link: https://www.appsheet.com/start/960ce629-97dd-4265-a01b-680a3a280045

@Kirk_Masden Thanks for your work on this. Is this still the best way to do this? Seems like it should be native to AppSheet but I guess itโ€™s not.

Thanks Lucinda! I agree that there should be a native function. Please vote for the following and checkout other workarounds discussed on this page:

Voted. I saw Thieryโ€™s response that itโ€™s being worked one. Looking forward to it.

I cannot upvote any feature requests for some reason unbeknownst to me. Does one have to have a paid Appsheet account to be able to vote? 

@Abhishek_Yerra

Could you share the example app link again? I am trying to enter this link ( https://www.appsheet.com/start/960ce629-97dd-4265-a01b-680a3a280045 ) but it does not allow me.

Thank you

You could always do a quick edit table with yes noโ€ฆ Itโ€™s a checkboxโ€ฆ

I see. Itโ€™s a great checkbox, but you need to tap on the edit icon first. Thatโ€™s one difference.

3X_0_6_0641847f39cc15b1bcd03e89bd6ce8696c87f0b5.png

3X_e_6_e6a8b339c4e3f1c5a2fb1a61b64ec463f369f144.png

By the way, I couldnโ€™t figure out what caused the horizontal dots to be shown instead of Y or N. I tried โ€œSave & Verifyโ€ but to no avail.

It looks bug to meโ€ฆ

By the way, the action icon at the upper right corner to enable the quick edit to table view you are on is not really recognizable to my end user and clients. I always need to guide them and explain to them hit it !!! Then you are able to get the exprerience like you are on the spreadsheet.

To make this action icon action stand out, I place the action icon in the overlay position.

The action is simple enough. Go to another view but actually return to the same view.

The deeplink expression is

LINKTOVIEW(โ€œYourTableViewYourAreOnโ€)&"&quickedit=true"

Awesome input @tsuji_koichi thank you.

Hidros
New Member

Excellent idea @Kirk_Masden. Thatโ€™s ingenuity!

Thanks!

Top Labels in this Space