cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JE_Forero
Regular Visitor

Data in Galleries

Good morning group, I have the following problem that I appreciate your advice to solve it

1-. My data source is a list in sharepoint - tbl_102_InventarioTICS

2-. On the scrActa screen in the OnVisible property I create a blank collection like so:

ClearCollect(colAgregarActivosActa01;Table(

{

    ActaNumero:"";

    FechaMovimiento:"";

    TipoMovimiento:"";

    TipoActivo:"";

    Proveedor:"";

    ValorActivo:"";

    Caracteristicas:"";

    Observaciones:"";

}

));;

Clear(colAgregarActivosActa01)

3-. Then, I have a gallery glrIngreso that connects to the data source tbl_102_InventarioTICS and I have the btnAdd button inside the gallery item with the following:

Collect(colAgregarActivosActa01;

{

    ActaNumero:lblNumeroActa.Text;

    FechaMovimiento:dpkFechaActa.SelectedDate;

    TipoMovimiento:cmbTipoMovimientoNuevo.Selected.Result;

    TipoActivo:ThisItem.TipoActivo;

    Proveedor:ThisItem.Proveedor;

    ValorActivo:"";

    Caracteristicas:ThisItem.Caracteristicas;

    Observaciones:txbNotasObservaciones.Text;

    Disponible:lblDisponibleSiNoActa.Text

}

)

This add button feeds the collection that I create blank in the OnVisible property of the screen colAgregarActivosActa01 and As you can see, I have some fields that are fed by some text or date labels outside the glrIngreso gallery and others with the ThisItem property of data from The galery.

 

4-. The problem: I have two problems. If I leave these two values at "" no errors are observed.

4.1-.     FechaMovimiento:dpkFechaActa.SelectedDate;

The error: Incompatible type, the collection cannot contain values of this type, so I don't know how to pass the date value

4.2-.     ValorActivo:"";

If I put ValorActivo:ThisItem.ValorActivo

Incompatible type, the collection cannot contain values of this type, this value is numeric

 

How could I pass these two values to my collection, one from a date element outside the gallery and the other the numeric value found inside the gallery.

 

Thank you for your support

Thank you

2 ACCEPTED SOLUTIONS

Accepted Solutions
cha_cha
Super User
Super User

Hello @JE_Forero 

 

I believe this problem started because you initiated the value of the properties to a string.

 

cha_cha_2-1670679205594.png

 

Two options you can do:

 

Option A: JUST DON'T INITIALIZE IT. Your OnVisible code should be just like that OR

Clear(colAgregarActivosActa01)

 

Option B: Initiate with the right type:

ClearCollect(colAgregarActivosActa01;Table(
{
    ActaNumero:"";
    FechaMovimiento:Today();
    TipoMovimiento:"";
    TipoActivo:"";
    Proveedor:"";
    ValorActivo:false;
    Caracteristicas:"";
    Observaciones:"";
}
)

 


  ✔️
Just in case my response helped you solve your problem, please mark/accept this as a SOLUTION This helps community members if they experience a similar issue in the future.

 

  🔗
🕸bistek.space  🐦 @cha_bistek  📺 @BisTekSpace 

 
Just in case you my answer helped you solve your problem, please mark/accept this as a SOLUTION This helps community members if they experience a similar issue in the future.

 
bistek.space   @charv3n    @BisTekSpace 

View solution in original post

Drrickryp
Super User
Super User

@JE_Forero 

Or use your list to create the blank collection.  That way, the collection schema will be identical to the list and allow you to easily add or modify the records using your collection. 

 

 ClearCollect(colAgregarActivosActa01, Defaults(tbl_102_InventarioTICS))

 

 

View solution in original post

5 REPLIES 5
cha_cha
Super User
Super User

Hello @JE_Forero 

 

I believe this problem started because you initiated the value of the properties to a string.

 

cha_cha_2-1670679205594.png

 

Two options you can do:

 

Option A: JUST DON'T INITIALIZE IT. Your OnVisible code should be just like that OR

Clear(colAgregarActivosActa01)

 

Option B: Initiate with the right type:

ClearCollect(colAgregarActivosActa01;Table(
{
    ActaNumero:"";
    FechaMovimiento:Today();
    TipoMovimiento:"";
    TipoActivo:"";
    Proveedor:"";
    ValorActivo:false;
    Caracteristicas:"";
    Observaciones:"";
}
)

 


  ✔️
Just in case my response helped you solve your problem, please mark/accept this as a SOLUTION This helps community members if they experience a similar issue in the future.

 

  🔗
🕸bistek.space  🐦 @cha_bistek  📺 @BisTekSpace 

 
Just in case you my answer helped you solve your problem, please mark/accept this as a SOLUTION This helps community members if they experience a similar issue in the future.

 
bistek.space   @charv3n    @BisTekSpace 
Drrickryp
Super User
Super User

@JE_Forero 

Or use your list to create the blank collection.  That way, the collection schema will be identical to the list and allow you to easily add or modify the records using your collection. 

 

 ClearCollect(colAgregarActivosActa01, Defaults(tbl_102_InventarioTICS))

 

 

Hello Cha_Cha
Thank you very much for your help, it works perfect

Hello drrickryp
Thank you very much for your help, this alternative has also worked for me

Hello Cha_Cha
Thank you very much for your help, it works perfect

Helpful resources

Top Solution Authors
Top Kudoed Authors
Users online (3,636)