Is there a way to easily copy an app, to refe...

references
(Frederik Munk Brønserud) #1

Is there a way to easily copy an app, to reference another spreadsheet with identical column structure?

I have a few identical, and rather complicated spreadsheets, upon witch I build two different apps for different user types.

Is there a way to copy the “same” app to reference the other data?

(Philip Garrett) #2

@Frederik

I think what Aleksi is suggesting is that you do the following: 1. Open your app in the Editor 2. Go to the Data > Tables pane 3. Expand the table you want to update. 4. Click on “Source” and select “browse for more data” 5. This brings up a file open dialog where you can select the workbook you wish to use.

The new workbook and worksheet you select must be absolutely identical in format to the original one. This will cause AppSheet to use the new worksheet in place of the old one.

Correct me if I am wrong @Aleksi_Alkio

(Aleksi Alkio) #3

When you copy the app, it asks “Make a copy of the data for the new app”. If it’s ON, it will create an identical copy from your spreadsheet and it will start to use it as a source. If it’s OFF, it will use the same existing spreadsheet as a backend source.

(Frederik Munk Brønserud) #4

@Aleksi_Alkio But is there a way to make the source of the copy another, existing sheet, that I have already made to have the exact same column structure?

(Aleksi Alkio) #5

Well… I haven’t tested but I believe in generally no.

(Aleksi Alkio) #6

Correct :smiley:

(Philip Garrett) #7

@Fernando_Lopez

If you are trying to move your app from one provider to another (Google Sheet to MySQL in your case), then you probably want to both copy your app and your data. That will essentially make a logical copy of your app on the new provider.

You can do this by: 1. Opening your current app in the Editor. 2. Going to the Manage > Author pane. 3. Clicking “Copy app” 4. Selecting the new provider (MySQL in your case).

(Frederik Munk Brønserud) #8

@Philip_Garrett_Appsh oh! I feel stupid - thank you very much! Sorry @Aleksi_Alkio, it seems I just didn’t understand

(Aleksi Alkio) #9

No problem :smiley:

(Fernando López) #10

Thank you @Philip_Garrett_Appsh, @Aleksi_Alkio I have a problem when “copy app”, I got this error:

Error Code: 1118. Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535.

This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs

The table has many columns, but the SQL code generated is:

CREATE TABLE appsheet-data-MiClubAdminDB-326606_ComandasDetalle ( IDClub VARCHAR(200) NOT NULL,

ID VARCHAR(200) PRIMARY KEY,

IDTurno VARCHAR(200) NOT NULL,

IDSesion VARCHAR(200) NOT NULL,

IDComanda VARCHAR(1024) NOT NULL,

Vaso VARCHAR(1024) NOT NULL,

Modo VARCHAR(1024),

TipoVaso VARCHAR(1024) NOT NULL,

NroProductos VARCHAR(1024) NOT NULL,

DetalleTexto TEXT,

Column_11 VARCHAR(1024),

Tipo1 VARCHAR(1024),

Producto_1 VARCHAR(1024),

Cantidad_1 VARCHAR(1024),

Column_15 VARCHAR(1024),

Tipo2 VARCHAR(1024),

Producto_2 VARCHAR(1024),

Cantidad_2 VARCHAR(1024),

Column_19 VARCHAR(1024),

Tipo3 VARCHAR(1024),

Producto_3 VARCHAR(1024),

Cantidad_3 VARCHAR(1024),

Column_23 VARCHAR(1024),

Tipo4 VARCHAR(1024),

Producto_4 VARCHAR(1024),

Cantidad_4 VARCHAR(1024),

Column_27 VARCHAR(1024),

Tipo5 VARCHAR(1024),

Producto_5 VARCHAR(1024),

Cantidad_5 VARCHAR(1024),

Column_31 VARCHAR(1024),

Tipo6 VARCHAR(1024),

Producto_6 VARCHAR(1024),

Cantidad_6 VARCHAR(1024),

Column_35 VARCHAR(1024),

Cantidad VARCHAR(1024),

Temperatura VARCHAR(1024),

Consistencia VARCHAR(1024),

Observaciones TEXT,

Precio DECIMAL(15, 2) NOT NULL,

Costo DECIMAL(15, 2),

Puntos DECIMAL,

FechaHora DATETIME NOT NULL);

I think the generator of these SQL core by default select varchar(1024), can you help me to reduce the size of these autogenerated types? Translate

(Fernando López) #11

All these vars varchar(1024) are enum type in my appsheet project

(Philip Garrett) #12

@Fernando_Lopez

The error message indicates that the data values in one of your rows is too long to fit in the MySQL record. Please check the actual length of the data contained in your “TEXT” columns. One or both of these fields may contain long data values.

(Fernando López) #13

@Philip_Garrett_Appsh I was investigating and the problem is not in the data length (verified, my data is by far shorter) is in the structure of the data (means the SQL generated when copy the app). By default the sql appsheet script generator assign 1024 to VARCHAR vars.

I tried to set MaxLength parameter (on Edit column definition) but it only works when type var is Text, but not when is REF or ENUM. Who can I consult about? Thanks

(Aleksi Alkio) #14

Then you need to change the source file… Data > Tables > Choose the table > Change the source

(Frederik Munk Brønserud) #15

@Aleksi_Alkio I’ved tried that, but it still seems to be quite a hassle… If it’s not possible to do an easier way, I would like to suggest the feature for future updates

(Aleksi Alkio) #16

May I ask why it’s “quite a hassle”?

(Stephen Mattison) #17

What about using Private Tables here?

(Frederik Munk Brønserud) #18

@Aleksi_Alkio When I delete the “old” data, to replace with the new, a lot of my presets fail, and must be individually pointed at the new data to work again. Same goes for workflows and slices…

@Stephen_Mattison I don’t think I understand you fully? What is a private table, and how would it be useful in this case?

(Aleksi Alkio) #19

IF your sheets are totally identical like column names and types are the same, it should not need any additional work. I have done that few times and it has worked quite easily.

(Fernando López) #20

@Aleksi_Alkio does it also work when changing the source from Google sheets to MySQL database?