date/time

I cannot express how much I appreciate the help from all of you!!

There is another function I want to have:

From the Date/time drop down menu, is there a way to choose multiple date at the same time? for now I can only choose one day. 

 

0 17 357
17 REPLIES 17

No. Create two columns--, e.g., start date and end date.

@dbaum Thank you very much for your reply! so you are saying there is no way to randomly choose multiple days at the same time?

It's unclear what you're trying to accomplish--especially when you reference both "the Date/time drop down menu", which implies the app user is selecting dates, and "randomly choose multiple days", which implies the app uses an expression with a RANDBETWEEN function to automatically select dates. Try making an EnumList type column with a base type of Date. If that configuration is possible, maybe it meets your needs. 

Sorry for my poor explaination. The picture is what my App looks like:

For DateTime I put valid if condition to stop people choose date before today, and after 9am today people can no longer order today:s lunch. 

For now people can only choose one day from the calendar, but there are people who want to randomly order different days lunchbox. I do not know how to use randbetween but thank you very much for your advice!

test.png

This may or may not be applicable in your case based on your overall app requirement. But you could evaluate a format as in the sample app shared below. Basically a format of referencing between tables. Referencing will also allow you to sum/sort orders by day and so on.

In the sample app below, each customer in the Customers table can order several Orders and several Order items in each order. You may want to study it. So in your case, each name ( Customers table in the sample app) can order lunch boxes on several days ( Orders table in the sample app) and possibly each lunch box can have several items to choose from ( Order Details Table and Products tables in the sample app.)

Order Capture How-to - AppSheet

References between tables - AppSheet Help

Of course , please study well the fitment for your requirement. The above is just a pointer for more relevant implementations for you to evaluate.

 

@Suvrutt_Gurjar thank you very much for your kind reply. It seems a bit complicated for me to achive this function😂. I thought I almost created my very first App...

You are welcome. Well, the more functionality, flexibility you wish to achieve in your app, you may need to also deal with more complexity in configuring an app or for that matter any system. 🙂

An ENUMLIST is usually used to capture multiple values in one column. It however does not allow DateTime nor Date type values to be captured.

If you really want to capture dates (no time) then you need to convert it to text.

One way to do this would be to create a column like this

TeeSee1_0-1673931465816.png

if(
 HOUR(TIMENOW() - "00:00:00") <= 9, 
 LIST(TEXT(TODAY(), "yyyy/mm/dd"),TEXT(WORKDAY(TODAY(),1), "yyyy/mm/dd")),
 LIST(TEXT(TODAY()+1, "yyyy/mm/dd"))
)
+
LIST(
 TEXT(WORKDAY(TODAY(),2), "yyyy/mm/dd"), 
 TEXT(WORKDAY(TODAY(),3), "yyyy/mm/dd"),
 TEXT(WORKDAY(TODAY(),4), "yyyy/mm/dd")
 ...
 ...
)

By this way you cannot completely prevent users from entering invalid dates - if they enter one manually but you just hope that users just select dates from the displayed list.

Having said this, I do not like this - multiple dates in one field because if you want to expand the app to include to manage lunch delivery in more detail - cancel, delivery confirmation, etc - then it becomes almost impossible.

You explained very clearly and it comes out exactly like what you have said. The multiple dates are all being sent to one field on my date sheet which I cannot sum the order anymore. I will do more research on how to do the references between two tables. 

The data sheet for collecting the orders:

test02.png

TeeSee1_0-1673934515404.png

Set both of these on your order form for easier data entry

@TeeSee1 you saved my life😊

@TeeSee1 I am sorry to bother you but is there a way to prevent duplicate for Datelist? as you can see for one cell there will be many or just one date, I tried to put initial value=[name]&[Datelist] for the [key] column, but when staffA want to order 2023/01/25 lunchbox the App says the name already exist, how can I solve this problem?

datelist.png

hi@TeeSee1 , I am asking Mr.Suvrutt_Gurjar the similiar question because he taught me how to use CONCATENATE to prevent duplicate but it does not work well if I use your suggest of  collect multiple dates into one cell. so I am in a lost now. 

 

My suggestion is NOT to collect multiple dates. It just makes things more complex because it is not flexible just like you are experiencing. List manipulation is not a very strong part of AppSheet..


@TeeSee1 wrote:

Having said this, I do not like this - multiple dates in one field because if you want to expand the app to include to manage lunch delivery in more detail - cancel, delivery confirmation, etc - then it becomes almost impossible.


You are very correct @TeeSee1 , a reason why we proposed referencing type configuration.


@Suvrutt_Gurjar wrote:

Basically a format of referencing between tables. Referencing will also allow you to sum/sort orders by day and so on.


 

 

 

Top Labels in this Space