Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8479881
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T19:09:21+00:00 2026-06-10T19:09:21+00:00

I have an array in the following format: agendaItems = [{topic:blah, description:blah}, {topic:blah2, description:blah2}].

  • 0

I have an array in the following format:

agendaItems = [{“topic”:”blah”, “description:”blah”}, {“topic”:”blah2″, “description”:”blah2″}].

I need to update the values in this array in a handler and handler does not allow global variables to be modified. I know I have to use either CacheService or ScriptProperties. However, I can’t seem to make it work:

If I use CacheService, I get something like this: “[object oject][object object]”

CacheService.getPublicCache.put('agenda', agendaItems);

If I use ScriptProperties, I get something like this: “”[Ljava.lang.Object;@429bd3a7”

ScriptProperties.setProperty('agenda', agendaItems');

Am I doing this wrong or is there a better way? Any advice is appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T19:09:23+00:00Added an answer on June 10, 2026 at 7:09 pm

    The Cache class works with strings. You have to use the Utilities.jsonStringify and Utilities.jsonParse methods to convert the array to a string and vice versa. Here is slightly modified code which I use

    this.getData = function(id, cacheKey) {
      var cache = CacheService.getPrivateCache();
      var cachedString = cache.get(cacheKey);
      var lstData;
      if (cachedString == null) {
        lstData = getNotCachedData_(id);
        cache.put(cacheKey, Utilities.jsonStringify(lstData));
      }
      else {
        lstData = Utilities.jsonParse(cachedString);
      }
      return lstData;
    }
    

    The ScriptProperties Service also works with strings. It is not obvious due to the not complete documentation, the value parameter has type var and not String, but it is true.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have 10 arrays with the following format: This is $data Array ( [0]
I have been given an array in the following format and need to put
Background I basically have an array, this array has the following format Array (
I have following array, that I need to operate by hand on bitmaps. const
All, I have the following array in array format. The JSON format is shown
I have a PHP array of associative arrays with the following format: array(1) {
I have an array in the following format: var markers = [ ['Title', 15.102253,
I have an array in the following format: Array ( [0] => Array (
I have an array that contains string with the following format: 1-a1,1-a2,1-a3,1-a4,2-b1,2-b2,2-b3,2-b4,3-c1,3-c2,3-c3,4-d1,4-d2 where a
I have a multi-dimensional array in the following format: [0] = ( 'id' =>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.