List Emails to send

Dear Experts, I ask for help

I need to obtain an email list of registered people, depending on the pre-selection of some criteria: For example: Function and Department of the person.

The System must present a LIST in the format of "ENUMLIST," THAT MATCH THE CRITERIA of OTHER COLUMNS, IN ANOTHER TABLE, as mentioned above.

____________________

Test expression1:

SELECT(Record[Email],
AND(
Record[Role] = [_THISROW].[Recipients],
Registry[Department] = [_THISROW].[Departments])
)

Test expression2:

SELECT(Record[Email],
AND(
CONTAINS(Shipping[Recipients],Registration[Function]),
CONTAINS(Shipping[Departments],Registration[Department])
))
________________

Record = Table
Shipping= Current Form Table

Function = TYPE Text
Department = Text TYPE

Recipients = ENUMLIST TYPE
Departments = ENUMLIST TYPE

Solved Solved
0 11 276
1 ACCEPTED SOLUTION

There may be other issues, but one I happened to notice in skimming this conversation is that you should remove "TABLE_1" from your IN functions. Instead just reference the columns from the table already cited in the SELECT function's first argument. For example: 

 

SELECT(TABLE_1[email],
AND(
IN([column 1_A], [_THISROW].[column 2_A enumlist]
),
IN([column 1_B], [_THISROW].[column 2_B enumlist]
)
)
)

 

View solution in original post

11 REPLIES 11

Not sure how all tables - Record, Registry, Shipping, Registration - are related but you should probably use IN() and also check how SELECT should be used, especially how you designate the table of the columns in your expression.

SELECT ( table[ col A ],

  [col B] = [_THISROW].[col C]

)

here, [col A] and [col B] belong to table, and [col C] belongs to the table that contains this expression.

If you want to use a third/forth/fifth... table then you need to use nested select.

Please read this article for more details ( there are a ton of links in it also that are useful in understanding how you build expressions, especially data retrieval.) 

https://www.googlecloudcommunity.com/gc/Tips-Tricks/When-to-use-thisrow/m-p/332009

It is not the solution. It is about filtering the emails of the people who belong to the function and department selected in the dropdown

type: ENUMLIST


Válido si   
SELECCIONA(Registro[Email], TRUE, FALSE)

_____________________________________
Valor inicial
ANY(SELECT(Registro[Email],
AND(
IN((Envío[Destinatarios],Registro[Función]),
IN(Envío[Departamentos],Registro[Departamento])
)))

Steve
Platinum 4
Platinum 4

It's not clear what you're asking from us.

What are the two two expressions, Test expression1and Test expression2? Why did you share them? What are they supposed to mean to us?

You're using CONTAINS() and IN() wrong.

Where are you trying to use your expressions?

Are you getting errors? If so, please post screenshots of the errors.

I need to get a list (ENUMLIST) of email addresses of people registered in a database in Table A (Registration), based on some criteria;

In the form of the second Table B (Sending), "the table that contains the expression", I must specify in two others (ENUMLIST), various search criteria among all the people registered in Table A (Registration), and bring me the emails that correspond to the people selected by these two values:
1º Function of the person;
2nd Department of the person;

The system must be able to find the EMAIL ADDRESSES of the registered people, who were targeted in the two search criteria, and relate in one (ENUMLIST), all these email addresses registered in the database of Table A (Registration) .

Do I explain well?

The two expressions that I wrote are so that you know what my reasoning is. But they didn't work.

Try

SELECT(
 Registration[email],
 AND(
  IN([function], [_THISROW].[function enumlist]),
  IN([dept], [_THISROW].[dept enumlilst])
 )
)

I think you also have role, which I believe is also in Registration.

Then you can just add   [role] = "recipient"  inside the AND().

ERROR

Parameter 2 of function IN is of the wrong type

If you want to compare text to text then use "=".

If you are testing whether a text value is in a list use IN(text value, a list) expression. You should make sure your columns are of the correct type.

SELECT(TABLE_1[email],
AND(
IN(TABLE_1[column 1_A], [_THISROW].[column 2_A enumlist]
),
IN(TABLE_1[column 1_B], [_THISROW].[column 2_B enumlist]
)
)
)

// I need to get a list (ENUMLIST) of email addresses of people registered in a database in TABLE_1[email], based on some criteria;

In the form of the second TABLE_2 , "the table that contains the expression", I must specify in two others (ENUMLIST), two search criteria among all the people registered in TABLE_1, and bring me the emails that correspond to the people selected by these two values:
[_THISROW].[column 2_A]
[_THISROW].[column 2_B]

The system should be able to find the EMAIL ADDRESSES of the people registered in TABLE_1[email], corresponding to the search criteria, and relate them in one (ENUMLIST), all these Email addresses registered in TABLE_2.

// column 1_A is column type TEXT
// column 1_B is column type TEXT
// Column 2_A is column type ENUMLIST
// Column 2_B is column type ENUMLIST

There may be other issues, but one I happened to notice in skimming this conversation is that you should remove "TABLE_1" from your IN functions. Instead just reference the columns from the table already cited in the SELECT function's first argument. For example: 

 

SELECT(TABLE_1[email],
AND(
IN([column 1_A], [_THISROW].[column 2_A enumlist]
),
IN([column 1_B], [_THISROW].[column 2_B enumlist]
)
)
)

 

 

Heloooo Dbaum!!! 

UAUUAAAUUUU!! Thank you very much!! It has worked!!! Thank you for your attention!!! I'm studying AppSheet a lot. And when I reach your level, I want to help many people too!!! Thank you

Top Labels in this Space