Use different initial value per view

Minoas
New Member

Hello, I am trying to make an expenses application

I have a generic data entry form, where I can set date, price, category, subcategory, and some other values.

I would like to create some specialized buttons for easier data entry of certain scenarios.

For example I could have a “Snack” button, when I click it, I am presented to a form that has pre-selected that the expense category is ‘Food’, normally the expense category is not food by default.

I saw that with a slice I can hide all the fields that are not relevant to the simple snack data entry, but I haven’t found a way to change attributes of the columns. I suppose it would be nice to be able to ‘override’ an attribute of a column. E.g. I would also like to make a snack appear with a slider for the price, with a range of 1 - 10. Normally values for other expenses would not benefit from having the slider.

So my questions, the later ones are only relevant if the first is achievable

  1. Can I achieve something like prefilled views, as described above?
  2. If 1 is yes, can I add a shortcut to such a view to the android home?
  3. If 1 is yes, can I make a page in my app that lists multiple such views, e.g. as icons, for easier access?

Thanks in advance!

0 5 923
5 REPLIES 5

If you had a separate table for sub-category, you could add a field called [View name] and then create a LinktoView virtual column (app type) that points to which view to go to (I name mine LinktoView). Then you set your behavior of the view to use that virtual column to go to a different input form (based on different slices) for each sub-category of expense.

LinktoView([View name],“your app name-number”) - This is the virtual app type column
Go to App Link (LinktoView) - This is under behavior (should be automatically added selection)

You could also add the default category and other prefilled values to be used and pass this into the main data table from the sub-category table.

You can add an image column to the sub-category table to show an icon and then use a gallery type view which would show icons for each sub-category and clicking on each would take you to a different input form with prefilled values.

Minoas
New Member

Hello Riki, thank you for the feedback!

I’m trying to implement what you outline, but need some more info if possible

What I have so far:

  • main table (expenses): price, category, date, etc
    – slice of main table called “Quick Food”
    – ux view of “Quick Food” called “Quick Food View”

  • 2nd table called “entry_types”
    – example row: entry type = snack, View Name = Quick Food View, Category = Food
    – Virtual column called “LinkToView” with value LinkToView([View Name], app-id)

How can I now open the “Quick Food View” and pass the entry_types.Category (“Food”) to expenses.category, by using the entry_types row seen above?

Quote:
You could also add the default category and other prefilled values to be used and pass this into the main data table from the sub-category table.

Provided Expenses Category column is a ref to Entry Types Category, you would use the Auto Compute section of the Expenses category column under the Initial value setting:

[Entry_types].[category]

Minoas
New Member

Hello Riki, thank you for all your comments!

I tried this out but seems that appsheet is looking for a column instead of table, the error I get is:

Column Name ‘Category’ in Schema ‘Expenses_Schema’ of Column Type ‘Ref’ has an invalid Initial Value of ‘=[entry_types].[Category]’. Error in expression ‘[entry_types].[Category]’ : Unable to find column ‘entry_types’

I will search around some more, but I you have any other ideas it would be of great help!

Best regards

Minoas
New Member

So seems I managed to get a first version working.

I have two tables:

  • expenses
  • entry_types

entry types has an app type column, I manually calculate the deep link because i didnt find how to do list expansion
Example:

entry type        View Name         Defaults                           Deep Link
Split the bill    Expenses_Form     {"Category":"Food","Owner":"both"} =CONCATENATE("#control=", ENCODEURL(B2), "&defaults=", ENCODEURL(C2))

The deep link ends up being something like: #control=Expenses_Form&defaults=%7B%22Category%22%3A%22Food%22%2C%22Owner%22%3A%22both%22%7D

Then I made a gallery view from entry types, where the event action on row selected is to “Go to App Link ( Deep Link )”. This way when i click on “Split the bill” it takes me to a pre-filled form where category is food and owner is both.

Cheers

Top Labels in this Space