List of lists in custom state (Jagged Array)?

I need to create a list of lists, example:

Custom State: Reps (List of Lists of Numbers)

  • Index 1: 8,10,12
  • Index 2: 1,
  • Index 3: 18, 22

Similar to a Jagged Array:
Screenshot 2023-10-18 at 5.50.19 pm

Is this possible?

Use case:
I have a RepeatingGroup that contains several inputs in each cell. Each cell creates a Thing, using the values from the inputs. I am using the Orchestra plugin to loop through and capture the inputs, which are added to custom states on the page container group.

For one of the inputs, users can select a checkbox that enables them to enter multiple ‘reps’ for an exercise. Essentially I want a custom state that has the following:

Custom State: Reps (List of Lists of Numbers)

  • Index 1: 8,10,12
  • Index 2: 1,
  • Index 3: 18, 22

For the following scenario:

Alternatively, it would also be great if I could create [a list of] temporary Things in a custom state, each with the values from the inputs, then write each to the database (Create a Thing) at the end of the workflow.

States cannot be nested. States cannot store temporary datatypes.

My approach with something similar was to use a JSON like structure in a text state.

Seems like such simple and powerful functionality that we would want to store things in memory without writing to the DB…

:expressionless:

Can you shed some light on how you use JSON to do this?

It’s not exactly JSON but like JSON. So a single text may look something like this

GroupA{SubGroup[SubSubGroup]}

Or for something simpler

Group A|Group B|Group C

I just use regex to grab the nested data. You just adjust it according to how you would store and access the data.

This topic was automatically closed after 70 days. New replies are no longer allowed.