Combining user-specified value with selected rows, and adding to different table

Hi all,

I’m fairly new to Appsheet but I couldn’t find a solution in the forum. I’m working on a music practice tracking app (similar to fitness tracking).

I have two views/tables:

  1. Log which is a list of music practice activities for a given day
  2. Elements which is the full list of practice activities

Right now, I can go to the Elements view, select multiple practice items, and run an action Data: add new to another table using values from this row which adds all them all to the Log table, which is great. However, in the behavior, I had to configure the date for those practice items to be today() since there is no way to select a specific date.

What I want to do is allow the user to schedule practice for a future date, which would mean combining a date picker + adding all the rows from Log to Elements.

Is there a way to do this? Thanks for your help!

Here are some screenshots to illustrate
Elements view

1 Like

Log view

1 Like

I imagine a two step process: first, the app user goes to a screen to choose a date, then goes to the screen to choose the activities. To choose the date, you’ll probably need a new table with one row per user and a column to receive the chosen practice date. When the chosen activities are saved, the action that adds each row can copy the chosen date.

1 Like

Thanks for suggestion Steve!

Two follow ups:

  1. would these steps appear as two distinct steps (from the user’s perspective ) or could they be “chained” in succession using grouped actions or something else?

  2. I understand conceptually what your saying, but can you offer some pointers on step 2 since I’m new to this? Specifically, I think it for step 2 I could copy the chosen activities to my main table with one of the actions, but I’m not sure how to simultaneously read the date entered in step 1. I’m guessing it would be some kind of select statement?

1 Like

I envision them as two chained steps: the use goes to a form view to choose the date. Upon saving the form, a Form Saved event action could be used to navigate the user to your existing activity selection view.

Currently, it sounds like you’re using an action of type Data: add new to another table using values from this row, and setting the new activity’s date with an expression of TODAY(). Instead of TODAY(), you’d need a (yep!) SELECT() expression to get the chosen date from the user’s date-chooser row.

If you’re using user sign-in:

ANY(
  SELECT(
    Date Choosers[Date],
    (USEREMAIL() = [User])
  )
)

Otherwise:

ANY(
  SELECT(
    Date Choosers[Date],
    (CONTEXT("Device") = [Device])
  )
)

The above assume you’ve created a table named Date Choosers to contain the row that records the user’s date choice. If your app uses user sign-in, your might use a column named Email to contain the email address of the signed-in user; otherwise, you might use a column named Device to contain the device identifier of the device user.

1 Like

Thanks for your detailed explanation! I’ll try playing with that and see where it goes from there

1 Like

@Steve thank you! That works great!

1 Like

FYI for anyone else who comes across this solution in the future, one thing that needed to done in step 1 (choosing the date) was to make sure that the update was done for the current user email, shown below.

1 Like