48
Views
7
Comments
[Local Storage Reactive] Set Item to Local Storage
local-storage-rwa
Reactive icon
Forge asset by Paulo Cação
Application Type
Reactive

Hello everyone

I want set a list on Local Storage, for this I serialize my list to json, but when I want set it this value is assigned empty

My Structures

My sets


When I do debug

The json has values

After set

What is my issue?


Thank you

2021-09-06 15-09-53
Dorine Boudry
 
MVP

can you share an oml, then I'll have a look.

at first glance from your screenprints, the first thing that jumps out to me as odd is the value you pass in for key.  I would expect that to be basic data type, like maybe a text, I don't understand why you send in a structure

2023-04-28 15-39-13
Artemio Sampayo Olivares

Hello Dorine

I share you the oml file.

Thank you

TestLocalStorage.oml
2021-09-06 15-09-53
Dorine Boudry
 
MVP

In both calls to SetItemLocalStorage you are passing in your local attribute "StructureLSEmployee.StructureEmployee", this is just a single text attribute, but as far as I can tell, this is an empty string, it has no relation to the employee you are trying to store.

Unfortunately, the action inputs of that component don't have descriptions, but I can imagine that this action just doesn't work with an empty string as key ?  It is designated as mandatory.

2023-04-28 15-39-13
Artemio Sampayo Olivares

Hello Dorine

Sorry, I think by do the app fast, I forgot write input descriptions.

Can you help me to tell me how Can I set value to structure to key LocalStorage?

It´s possible use te same oml that I shared you?


Thank you so much

2021-09-06 15-09-53
Dorine Boudry
 
MVP

I don't mean your descriptions, I mean the descriptions on that forge component.



the key would be whatever you want to use later to retrieve the data from local storage, I can't tell you what that should be...  Maybe just simply something like "MyLocalEmployeeList" ???


Apart from that, I really don't understand what you are trying to achieve, I don't understand what you are doing there with that client variable in that If

2023-04-28 15-39-13
Artemio Sampayo Olivares

Hello Dorine

I want to storage structures in my local storage for after I can save in my Entities in sever side.

Thank you

2021-09-06 15-09-53
Dorine Boudry
 
MVP

ok, so what is that If doing with that client variable ?

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.