User Manual

Read From Local Storage

19/5/25
Read From Local Storage

The Read From Local Storage action is used to read and use data stored permanently in the browser's Local Storage area within the application.

Purpose and Usage of the Action

  • It is ideal for long-term data storage scenarios such as user preferences, session information, or application settings.
  • It is frequently used in cases such as remembering logged-in users, preferred language settings, and theme selection.

Technical Features

  • Persistent Data Reading: Data corresponding to a specific key is retrieved from Local Storage.
  • Key-Based Access: Each piece of data is accessed through a defined key.
  • Data Can Be Transferred to Subsequent Actions: The read data can be used in other actions (e.g., Set Value).
  • Web & Mobile Compatibility: The action works in both Kuika's web and mobile applications.

Read From Local Storage Action Application Steps

1. Define the Action in UI Design

  • Log in to the Kuika platform.
  • Open your project from the Apps screen.
  • Go to the UI Design module.
  • Select the element you want to add the action to (e.g., a button).
  • Open the Properties panel on the right side.
  • From the ADD ACTION menu, select Local Storage → Read From Local Storage according to the trigger event you want (Initial Actions, OnClick, OnBlur, etc.).

2. Configure Action Parameters

  • Key (String - Required): The key name of the data to be read from Local Storage. For example, “userToken” or ‘themePreference’
  • Can be linked from sources such as Fixed, Screen Input, Current using the Symbol Picker.

Use Case: Automatic Loading of Theme Settings

After the user sets the application theme to “Dark Mode,” this preference is saved to Local Storage with the key “theme.” When the user reopens the application, this value is read with the Read From Local Storage action, and the interface automatically switches to “Dark Mode.”

Application Flow

  • The Read From Local Storage action is added to be triggered when a button, page, or screen is loaded.
  • The key field is entered as “theme.”
  • Then, with the Set Value action, the read value is transferred to a Component (e.g., page theme).

Read From Local Storage Action Advanced Customizations

  • Conditional Theme Change: An action to change the theme based on the read value can be added with an If condition.
  • Automatic Reading on Page Opening: Can be defined in Initial Actions to run when the page loads.
  • Use with Redirection: If no data is found, the user can be redirected to the login screen (with the Navigate action).

Technical Risks and Controls

  • Invalid or Empty Key: Returns null or undefined when an undefined key is entered. It should be handled with conditional control (If).
  • Data Format Incompatibility: If the read data is in JSON format, Parse JSON may be required.
  • Browser Incompatibility: Very old browsers may not support Local Storage. The application should be tested according to the user base.
  • Performance Risk: Storing and reading large data blocks in Local Storage may reduce performance. Lightweight data should be preferred.
  • Security: Sensitive data (passwords, tokens) should not be stored in Local Storage without encryption. Otherwise, it becomes vulnerable to XSS risks.

With this structure, you can offer a more personalized and sustainable experience to users by using the Read From Local Storage action.

Other Related Content

No items found.

Glossary

No items found.

Alt Başlıklar