Recently updated with examples: https://help...

expressions
(Steven Coile) #1

Recently updated with examples:

https://help.appsheet.com/expressions/functions/date https://help.appsheet.com/expressions/functions/datetime https://help.appsheet.com/expressions/functions/time

Any other examples you’d like to see in these?

(Andrew Eills) #2

Thanks for doing these.

IN and CONTAINS would be good.

I found these guides great when I started out with Appsheet, and I still refer to them.

Where I struggle, now, is with more complex expressions, e.g., one that requires a combination (in the right sequence) of IN, SELECT, AND, NOT, ISBLANK, (_THIS) with the right select filter(s) in the right place.

At the moment, I scour the forum, looking for similar, complex expressions, and try to infer what mine should look like.

More complex expression examples would be much appreciated, though I can see that they are more difficult to provide guidance for.

(Steven Coile) #3

IN() and CONTAINS() are coming, as are the rest, but it’s slow-going because I have very limited time.

I’m very interested in knowing what sort of complex expressions would be helpful. Can you provide some suggestions?

(Andrew Eills) #4

Anything you can do to increase the body of easy-to-find knowledge is very much appreciated and, given your limited time, you are churning out guidance at a jaw-dropping rate!

  1. Here’s the latest one I struggled with:

Linktofilteredview(AuditBaseQs, OR(IN([BaseQID], Select(Controls[RelatedBaseQs], IN([_Thisrow].[ActivityID], [RelatedActivities]))), IN([BaseQID], Select(Standards[RelatedBaseQs], IN([_Thisrow].[ActivityID], [RelatedActivities])))))

This pulls all the Base Questions related to the current Activity.

The Base Questions table has refs to and is populated from the Controls and Standards tables and I needed to pull the BaseQs from the Ref_Rows in each of the two tables, IF the tables Ref-Rows of Activities contained the current Activity.

  1. This is one that Aleksi helped someone with:

SELECT(TableName[STATUS],[PROJECT]=[_THISROW].[PROJECT] + LIST([_THIS])

I’m fine with this, up until the “+ LIST([_THIS])” bit!

Aleksi then upped the anti with:

SELECT(TableName[STATUS],[PROJECT]=[_THISROW].[PROJECT] + SELECT(TableName[STATUS],[KeyColumn]=[_THISROW].[KeyColumn])

I guess the “+” adds. the lists.

Take a deep breath…

One that Aleksi put into a sample app for me:

=IF(IN([ID],Schedule[ID]), SELECT(Roles[COURSES],IN([ROLE],[_THISROW].[ROLE]),TRUE)SELECT(Schedule[COURSE],AND([EMP]=[_THISROW].[EMP],NOT([ID]=[_THISROW].[ID]))), (SELECT(Roles[COURSES],IN([ROLE],[_THISROW].[ROLE]),TRUE)-SELECT(Schedule[COURSE],[EMP]=[_THISROW].[EMP])))

I’m not saying any guidance should have examples this complex, but it would be good to have simple examples of things like: A. “+” and “” of lists

B. the logic to the order in which expression parts should be put together for a working expression

C.

How, when and where to use, (_This).

Try searching for the phrases, “(_This)” or “IN(” or “AND(” or “NOT(IN(” in this forum or from the main Appsheet Customer Support page.

D.

Expression/statement techniques to use when an app contains a junction table to provide many-to-many relationship functionality (junction tables are great, but they do demand more complex expressions)

You and others on the forum are great at providing guidance to specific problems, and I suspect there’s a lot of guidance in the forum that I miss out on, simply because it is difficult to pinpoint.