Hello,
I'm in trouble. I created an APP that works online and offline too. It consists of a checklist and the record of each line contains three columns of images captured by the camera control. Basically, the user can upload data to the Sharepoint List at the end of the APP, when the CheckList is finished, or on the initial screen after the APP verifies that it is OnLine. The code below works when the user clicks the Save button at the end of the Check List. If the APP is connected, the collected data is instantly sent to the Sharepoint list; otherwise data is saved in device memory. My problem is: I cannot retrieve images saved into device's memory and upload them in Sharepoint List.
Set(
_varDados;
Patch(
_varDados;
{
FotoHypoxylon: img_hypoxylon.Image; //here, when online, the image is upload successfully to the Sharepoint List
FotoFace: img_face.Image; //here, when online, the image is upload successfully to the Sharepoint List
FotoSuperficie: img_superficie.Image //here, when online, the image is upload successfully to the Sharepoint List
}
)
);;
ClearCollect( //here I collect data saved in the variable in a collection
_colDados;
_varDados
);;
If(
!IsBlank(_colDadosSalvos); //here I verify If there is data stored into device's memory. If it's true, I collect this data too.
Collect(
_colDados;
_colDadosSalvos
)
);;
If(
Connection.Connected;
ForAll(
_colDados;
Patch( //here I send the data collected in _colDados to the Sharepoint List
ASTP;
{
UP: UP;
'Presença de Hypoxylon': Hypoxylon;
'Tipo de Fungo': Tipo;
'Foto Hypoxylon': img_hypoxylon.Image; //here I reference the field directly to the image object. If I refer to the value of the respective image within the variable, the image does not appear in the Sharepoint List and I don't know why.
'Foto Face': img_face.Image; //same as above
'Foto Superfície': img_superficie.Image //same as above
}
)
);;
Notify("Dados salvos na nuvem com sucesso!");
SaveData( //If APP is Offline, the data is stored into device's memory.
_colDados;
"dadosSalvos"
);;
Notify("Dados salvos na memória com sucesso!")
)
Here is the code when AppOnStart:
LoadData( //So, when the APP is started, I collect all stored data in device's memory in a collection named '_colDadosSalvos'
_colDadosSalvos;
"dadosSalvos";
true
)
Here is the code when App is Connected and the user wants to upload data saved in device's memory to Sharepoint List:
If(
Connection.Connected;
If(
CountRows(_colDadosSalvos.UP) > 0; //If there is data in device's memory, do..
ForAll(
_colDadosSalvos;
Patch(
ASTP;
{
UP: UP;
'Presença de Hypoxylon': Hypoxylon;
'Tipo de Fungo': Tipo;
'Foto Hypoxylon': FotoHypoxylon; //The value of this field is in the following format: 'SessionStorage/resized-378caeb8-9ab1-4fb7-9e5b-0d9298193034.jpg'
'Foto Face': FotoFace; //Same format as above
'Foto Superfície': FotoSuperficie //Same format as above
}
)
);;
Clear(_colDadosSalvos);;
SaveData(_colDadosSalvos;"dadosSalvos");;
Notify("Atualizações enviadas para o servidor com sucesso!");
Notify("Não há dados na memória!")
);
Notify("Sem acesso a rede")
)

Report
All responses (
Answers (