Need per-row variable in list section of screen

I'm still working with the scenario from my last post, but with a different problem. Here's the scenario this time:

I have a 'listitem' table with two rowlink fields: one linked to the 'list' table and one linked to the 'item' table. I'm working on a screen that creates rows in the listitem table - adding a predefined item to a working list.

My screen has a screen-level variable that holds the id of the list that I'm working with. There's a 'List' section of the screen that has rows for each candidate item. There's a button on each row that allows the user to select a specific item and create a listitem row that links that item to the working list.

All of that works just fine at this point. Here's the problem: When a user adds an item to a list, they should also be able to specify a quantity (among, perhaps, other things). The quantity has to go in the listitem table. However, the 'List' portion of the screen is displaying rows from the item table instead. I need to have a 'quantity' field that the user can edit, and it should be in each row of the list on the screen. I've attached a screenshot showing what I think it should look like. The problem is that Honeycode does not allow variables in list sections - only columns from the table being listed.

Any suggestions?

Hi @Mr-Bill, thanks for your post! :slight_smile:

Here's some info and suggestions that may be helpful.

Sounds like you may need to also have a quantity column (and columns for other desired values) in your items table. (You'll want to ensure that you have columns for all the desired user input values).

I also feel like an easier user flow and set up would be to have a designated form screen for users to input data. The App Wizard helps you set up form screens pretty cleanly, and you can still modify what displays on your summary screen, if you would like.

For the second part of your post, if you wish to be able to make a field in a list editable as in your attached photo, you can do so by changing the properties of the data cell in Builder.

To do so, open this screen in Builder and select the data cell in the list which you want to make editable. Then in the right-hand properties panel, check the "Editable" box.

Screen Shot 2020-08-06 at 1.55.36 PM

Now when you view the list, you are able to edit the value in that field directly on the screen.

Let me know if these suggestions help. :honeybee:

Thanks. My issue is that the rows I'm displaying are from the item table, but the row I'm adding is a different table. Quantity is not an item field as the same item could have different quantity in each list it's included on. The listitem table links an item to a list and has the quantity for that item on that list. Does that make sense?

It's a bit confusing since I have a table named'list'and you have a screen object named 'list'.

OK - back from the no-Internet wilderness. I should have included a picture in my original post. Here's the schema from the database that we used before we started the Honeycode port. There are three tables:

  1. 'list' table, on the left. Contains information about a specific list. When a user is working with the application, they will have created a row in the list table.
  2. 'item' table, on the right. Contains information about items. In this application, an item might be references by many lists, and the item information persists even if a specific list is deleted.
  3. Finally, the 'listitem' table in the center. When a user is adding an item to a list, what they're really doing is creating a row in this table, connecting an existing item to their list.

There's information in the listitem table that is not a characteristic of either the list or the item itself. 'Quantity' is a good example. There could be a 'sleeping bag' that has weight, size, color, an image, and a description in the item table. On a backpacking trip list I might want just one, but on a kayak trip I might want two.

The problem I have is that the user needs to choose an item to add to their list. I want to show a list of items to choose from , based on a search. Whatever item they choose to add, I need to let them specify a quantity. I can't currently display a quantity field along with data from the search of the item table.

Hi @Mr-Bill,

Thanks for the follow up and providing your data schema, that helps me better understand your scenario. :slight_smile:

To achieve what you're asking, you can set up your tables in the following way:

  1. "List" table, which has the attributes for the lists (i.e. list name, date of trip)
  2. "Item" table, which has the attribute for the items (i.e. item name, weight, size, color)
  3. "ListItem" table, which is the join table for two tables above with rowlink columns for each, and also has it's own attributes (This is where you would put the "quantity" column)

For the app:

Once you have the quantity column in the "ListItem" table, you could then create a screen with a list (of "ListItem") that allows you to select an existing List (i.e. backpacking trip), Item (i.e. tent), and add a quantity of that item just for that list. Allowing you to say for example, I want to bring two tents on the backpacking trip.

You can make the quantity field (or any other field) directly editable in the list as shown in my previous post.

If you'd like users to be able to create new lists, and add items and specified quantities accordingly, here's a set up that could work:

Create a screen that allows users to add new lists or select existing lists.

Then on the List details screen, you can add a field for users to select an item to add (a rowlink field that selects from the "Items" table) and another field for users to enter a quantity. Then add a button that will add the input to the "ListItem" table for the list on the given screen.

Here's how the button is set up, it's an automation that adds a new row to the "ListItem" table based on the input on this screen:

Screen Shot 2020-08-11 at 1.09.04 PM
Screen Shot 2020-08-11 at 1.04.28 PM

On the same list details screen, add a list of "ListItem," which you can filter to display just the items added to the particular list.

The filter in my example is set up like this:

Now you'll have a screen where users can add items and a specified quantity to a given list. :slight_smile:

I hope this is a helpful example. The styling of the app and screens is up you, but let me know if this helps clarify concepts. :honeybee:

1 Like

Thanks - that's a great example. It looks like the key difference is that you're presenting the items as choices in a selection box, rather than displaying a list of items to choose from. This would work for me, though I'd rather have the list so that I can show more than one item field - for instance, I'd like to show the name, description, and an image for each item.

I have the same automation approach, though this example will help others to get there in less time than it took me.

I had another idea that also works, and it allows me to display a list of choices from the item table, with more than one field on each line. Here's how it works:

  • I created a placeholder field in the item table. I called it 'hcwa1' (for HoneyCode WorkAround 1). The contents of this field in the item table are never used for anything.
  • I can now have a 'Qty' data cell on each row of the list, with shared source of [hcwa1].
  • The automation creates the listitem record (as in your example above) using the user-entered value from the 'Qty' data cell.
  • I added another automation to set the [hcwa1] field in the item row back to a default value (1 in this case)
1 Like

Hi @Mr-Bill,

Great, that works too :slight_smile: Thanks for sharing what you came up with!

I'm happy the example I gave was helpful, and yes, mine demonstrates selecting an item to add from a picklist, while yours displays a list of item choices to add.

We appreciate you sharing your building process with us here. It's great to see how you're using Honeycode, and these ideas can be helpful for others. :honeybee:

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