Hi.
I have a table with different city halls users. For example:
- Name: Jose
- Telephone: 346666666
- City Hall: Alameda
Then I have a Table called AlamedaTable with columns:
- Name
- Description
- Date
When user starts a conversation via WhatsApp I get the telephone, get the record from City Hall users and get the City Hall name ("Alameda")
I want to insert a record into the Table called AlamedaTable so I have created this code:
await {{user.usuarioAyuntamiento[0].Ayuntamiento}}.createRecord({
NombreEvento: 'Arbolada 2024',
Descripción: 'Plantar arboles',
Fecha: 'Del 27-28 de febrero'
})
But createRecord only works if I do this:
await AlamedaTable.createRecord({
NombreEvento: 'Arbolada 2024',
Descripción: 'Plantar arboles',
Fecha: 'Del 27-28 de febrero'
})
Anyone knows how can I create a code so I can insert into different tables depending on the name of the City Hall?
Hope I have explained my self well.
Thanks in advance!!