+ Reply to Thread
Results 1 to 2 of 2

Excel Online Office Script : Arrays and setValues problem

  1. #1
    Registered User
    Join Date
    10-15-2021
    Location
    Brussels
    MS-Off Ver
    Office365
    Posts
    2

    Excel Online Office Script : Arrays and setValues problem

    Hello,

    I'm starting to use Excel Office Script on Excel Online and I have a problem with the creation of an array to make a unique setValues. My function is inside an async function.

    1°) I call a jotForm API and gets an object in return
    2°) I need to iterate through the object and gets some multiple answers

    My problem is in the iteration : I'm getting in return an array like this
    ["Question1-element1","Question1-element2,"Question1-element3","Question2-element1","Question2-element2","Question1-element3"]

    But because of setValues and how to write answers to each rows, I need to return an array like this :
    [["Question1-element1","Question1-element2,"Question1-element3"],["Question2-element1","Question2-element2","Question1-element3"]]

    There each questions are divided and will be written on a different row.

    Here is my code :


    Please Login or Register  to view this content.
    What I get from that is all the answers in one line.
    But I can't seem to figure out how to push each answer in an array structure like : [[],[],[];[]]. Instead, I get the array structure [,,,,]. I need it because of the setValues in the end :

    Please Login or Register  to view this content.
    Any chance someone could have an easy fix for that ?

    Thank you in advance,

    Cedric

  2. #2
    Registered User
    Join Date
    10-15-2021
    Location
    Brussels
    MS-Off Ver
    Office365
    Posts
    2

    Re: Excel Online Office Script : Arrays and setValues problem

    The last part is (but when I choose to edit, it returns something blank) : workSheet.getRangeByIndexes(1,1,subRows.length,subRows[0].length).setValues(subRows);

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Having trouble entering arrays in Excel online
    By Ellwood in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-30-2019, 05:49 PM
  2. edit script button in excel online
    By tselek1985 in forum Excel General
    Replies: 1
    Last Post: 08-05-2016, 07:30 AM
  3. Excel online attendance script
    By TheEnsanguined in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-31-2016, 09:46 PM
  4. Associate an e-mailed Excel spreadsheet with Office Online
    By davidchicks in forum Excel General
    Replies: 1
    Last Post: 07-11-2006, 02:05 PM
  5. [SOLVED] Can't access Office Online from Excel Application
    By beenplaces in forum Excel General
    Replies: 3
    Last Post: 06-17-2006, 11:20 AM
  6. Replies: 2
    Last Post: 03-21-2006, 06:00 PM
  7. [SOLVED] When I open Excel, Office Online also opens which I don't want
    By bill in forum Excel General
    Replies: 1
    Last Post: 03-21-2006, 02:45 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1