Client Side Storage and Variables

I am trying to add information and pictures from identification booklets and put it into a Client side storage that can then be retrieved again at various points in the app. At the moment I can’t see/find where it is best to add this “backend” information. I need the app to work offline hence not making a database in the cloud etc.

I am also struggling to then retrieve the information again (using list buttons), maybe because I have not added information in the right place or maybe because I am not using the variables correctly but I keep getting the “Incompatible / list of objects is not assignable to the list of objects”.
I have watched your tutorial several time but it’s not helping me with what I am trying to do. I can get it to work on the Cloud Storage like the tutorial but when I go back to using Client-Side Storage it stops working. Hoping you can help me in the right direction.

1 Like

Hi there!

The only essential difference between the Cloud Storage and Client-Side Storage is that with Client-Side Storage you’ll need to manually specify ‘id’ properties with the GENERATE_UUID formula function.
Otherwise you should be able to apply the same steps for both storage types.

As for the incompatible list issue, if you can provide some screenshots along with descriptions of the data in the variables, I’ll be able to further assist you.

Hi Akseli,

Thank you for your reply. I might wait the 2nd part until I actually manage to get data stored on the Client-Side Storage.

I am not sure I fully understand how to manually specify ‘id’ properties. Also, this may or may not be related, is the only way of adding information to the Client-Side Storage as shown in your employee tutorial ie using the app or can you directly put information into the backend/Client-Side Storage?

Hi

The difference specifically is that when using ‘Create record’ flow function you don’t need to specify and id when using Cloud Storage, but when using Client-Side Storage the ‘record properties’ will have an ID field you should populate with for example GENERATE_UUID.

At this time there is no way to interact with either of the storages aside from the data variables and the create/get/update/delete -record flow functions.

Hope this made things clearer!

Akseli,

I’m using client-side storage and I create the record using GENERATE_UUID. I’m having a difficult time trying to figure out the ID field for ‘Update Record’. I currently use this formula…
STRING(LOOKUP(FIRST_ITEM(data.dataList), “id”))
…but I noticed when I make updates to records I lose records. And when I delete the updated records I can see the previous IDs and record field values prior to the update. I don’t get any errors performing the Create or Updates.

I pasted as much of my setup here as I could, please take a look and see where I’m went wrong. Thanks!

image

I tried STRING(LOOKUP(FIND(data.dataList, item.listAddress==pageVars.pageAddress), “id”)) but I get the following…

image

I first select a filter from a drop down field, pageStreet, to use in the ‘list item’ using the following formula:
UNIQUE_BY_KEY(MAP(ORDER(data.dataAddressList,item.items,“desc”),{label:SPLIT(item.items," “,2)[1], value:SPLIT(item.items,” ",2)[1]}),“label”)

I get the pageAddress from a repeated ‘list item’, once tapped the flow follows as shown above. The ‘Repeat with’ formula is:
MAP(SELECT(ORDER(data.dataAddressList,NUMBER(item.items),“asc”), CONTAINS(item.items,pageVars.pageStreet)),{label:item.items, value:item.order})

========= Update =======
Ok, when using the MAP function in the ‘Repeat with’ I lost the ability to use the ‘Data item in repeat’ correctly, meaning the current properties were not options, only value and label were choices (which were defined in the MAP function). I just removed the MAP portion of the formula and I was able to see the schema. This most likely led to the original ‘Update record’ problem with utilizing the correct recID.

I was able to get the ‘Update record’ to work correctly by using a FIND in the ID field. Since I got rid of the MAPs, I was able to use ‘repeated.current.items’ for the equate statement in the following formula…

STRING(LOOKUP(FIND(data.dataList, item.listAddress==repeated.current.items), “id”))