Issue with Duplicate Actions and Unrecognized Actions in AppSheet

Hello AppSheet Community,

Iโ€™m encountering some issues with actions in my AppSheet application, and I hope someone can provide guidance on resolving them. Here is a detailed description of my setup and the problems Iโ€™m facing.

Application Setup

I have two main tables: Attivitร  (Activities) and Clienti (Clients).

โ€ข Clienti Table:
โ€ข IdCliente (Key)
โ€ข Nome
โ€ข Cognome
โ€ข Mail
โ€ข Telefono
โ€ข Attivitร  Table:
โ€ข IdAttivitร  (Key)
โ€ข Tipo attivitร  (Type of Activity)
โ€ข Data e ora (Date and Time)
โ€ข Descrizione (Description)
โ€ข IdCliente (Ref to Clients)
โ€ข Telefono
โ€ข Mail

Objective

1. Verify Client:
โ€ข Check if the client exists in the Clienti table using the Telefono or Mail from the Attivitร  table.
โ€ข If the client doesnโ€™t exist, add a new client to the Clienti table.
2. Register Message:
โ€ข Once the client is verified or added, create a new activity in the Attivitร  table with details from the WhatsApp message or email.

Actions Created

1. Verify Client:
โ€ข Type: Data: execute an action on a set of rows
โ€ข Referenced Table: Clienti
โ€ข Referenced Rows: SELECT(Clienti[IdCliente], OR([Telefono] = [_THISROW].[Telefono], [Mail] = [_THISROW].[Mail]))
โ€ข Referenced Action: Verifica e crea cliente
2. Register Message:
โ€ข Type: Data: set the values of some columns in this row
โ€ข Set Columns:
โ€ข IdCliente = ANY(SELECT(Clienti[IdCliente], OR([Telefono] = [_THISROW].[Telefono], [Mail] = [_THISROW].[Mail])))
โ€ข Descrizione = "Rispondere a " & [Tipo attivitร ]
โ€ข Scadenza = NOW()

Problems Encountered

1. Duplicate Actions:
โ€ข When I create an action, AppSheet sometimes creates a duplicate action with a suffix -1 (e.g., Registra messaggio Action - 1). These duplicate actions are not visible in the main action list but appear in the process configuration.
2. Unrecognized Actions in Processes:
โ€ข When configuring the process, the custom actions Iโ€™ve created are not recognized. The process fails with errors like:
โ€ข The data action โ€˜Registra messaggio Action - 1โ€™ does not define a valid expression for reference rows. This expression must compute a list of Ref values.

Steps Taken

1. I ensured the action settings are correct and set to be visible.
2. I matched the table settings between the actions and the process steps.
3. I tried refreshing the AppSheet interface and recreating the actions and processes from scratch.

Despite these efforts, the issues persist, and Iโ€™m unable to achieve the desired functionality. Any insights or suggestions to resolve these problems would be greatly appreciated.

Thank you in advance for your assistance!

0 2 279
2 REPLIES 2


@ilanbo wrote:

If the client doesnโ€™t exist, add a new client to the Clienti table.


There 2 ways to handle this:

1)  AppSheet's built-in way  - you can configure the "IdClient" column on your Activity table to provide a New button on the dropdown list.  As a REF column this should be provided by default.  If the user doesn't find the Client in the dropdown list, they can tap New and add the Client row right then and there - no need for extra actions to save the Client.

Screenshot 2024-06-28 at 9.32.15โ€ฏAM.png

2)  The way you have implemented - Have the user enter the new Client details and then save a new row if it doesn't exist.  BUT, As you have discovered it does require checking by the details  to ensure you are not duplicating and you have to inspect these ON EVERY SAVE to ensure the Client exists.  You also need to include extra columns in the Activity table to support capturing the data for a new Client save which should also include the Name.


@ilanbo wrote:

AppSheet sometimes creates a duplicate action with a suffix -1 (e.g., Registra messaggio Action - 1). These duplicate actions are not visible in the main action list


If you name an action the same as one that exists ANYWHERE in the action list, AppSheet will automatically add the numeric suffix - this indicates you attempted to enter duplicate action names.  These should be visible in the main action list.  It may be that you have them filtered out somehow.


@ilanbo wrote:

When configuring the process, the custom actions Iโ€™ve created are not recognized.


Processes will only show actions IF they are configured for the same datasource AND the action has been saved successfully.  The error "does not define a valid expression for reference rows"  will not save successfully, I believe, and therefore will not show in list of valid actions.  "Reference Rows" property in a action needs to have an expression that returns a list of ROW KEYS for rows in the proper table specified in the action.


@ilanbo wrote:

Any insights or suggestions to resolve these problems would be greatly appreciated.



It would help if you can show examples of each issue you're facing so we can help better with your specific use cases.

 

Thanks for your answer!

I add some details:

I am developing an application using AppSheet for managing customer interactions and activities. The app primarily handles communication through WhatsApp and email, and it aims to streamline the process of recording and responding to these interactions.

Tables and Structure

The app consists of two main tables: Clienti (Clients) and Attivitร  (Activities).

1. Clienti Table:
โ€ข IdCliente (Key): A unique identifier for each client.
โ€ข Nome (Name): The first name of the client.
โ€ข Cognome (Surname): The last name of the client.
โ€ข Mail (Email): The email address of the client.
โ€ข Telefono (Phone): The phone number of the client.
2. Attivitร  Table:
โ€ข IdAttivitร  (Key): A unique identifier for each activity.
โ€ข Tipo attivitร  (Activity Type): Specifies the type of activity (e.g., WhatsApp received, Email received).
โ€ข Data e ora (Date and Time): The timestamp of the activity.
โ€ข Descrizione (Description): Details of the message received.
โ€ข IdCliente (Client Reference): A reference to the Clienti table to link the activity to a client.
โ€ข Telefono (Phone): The phone number associated with the activity.
โ€ข Mail (Email): The email address associated with the activity.

App Requirements

1. Client Verification and Creation:
โ€ข When a new activity (WhatsApp message or email) is recorded, the app should verify if the client already exists in the Clienti table using the Telefono or Mail from the Attivitร  table.
โ€ข If the client does not exist, the app should automatically create a new entry in the Clienti table with the details provided in the activity.
2. Activity Registration:
โ€ข After verifying or creating the client, the app should create a new record in the Attivitร  table with the details from the WhatsApp message or email.
โ€ข This record should include linking the activity to the client using the IdCliente reference.

Desired Workflow

1. A new WhatsApp message or email is received and recorded as a new activity in the Attivitร  table.
2. The app checks the Clienti table to see if the client exists based on the phone number or email.
3. If the client exists, the activity is linked to the existing client.
4. If the client does not exist, a new client entry is created in the Clienti table, and the activity is then linked to this new client.
5. The app maintains a clear and organized log of all activities associated with each client.

Goals

โ€ข Automate the client verification and creation process to ensure no duplicate clients are created.
โ€ข Simplify the recording of new activities to ensure all relevant details are captured and linked to the correct client.
โ€ข Ensure the app can handle both WhatsApp messages and emails seamlessly.

I hope this provides a clear understanding of the requirements and objectives of the application I am developing. If any additional details are needed, please let me know.

thanks again for your help very appreciated

Top Labels in this Space