Fórum Fórum

Voltar

Filling table with variable list data

Alternar
Filling table with variable list data
Resposta
06/09/22 08:08
Hello Smartbuilder Support!
I hope that I am not trying to achieve the impossible, but here we go:

I would like to use a table for its proportional scaling of individual pieces of text. However, in an ideal world, I would like these pieces of text to appear row by row, without making use of 1.000 tables.
The final solution needs to be a working solution for our team, which has as little moving pieces as possible, so that they would only have to fill in a "Data" table, placed offscreen.
The Actions would handle the scaling and displaying this data in a "Display" table row by row, visible to the Final User.

About an hour of tinkering with the Action blocks, I realize I can GET a lot of info and data from any row, column or cell I would like, but I cannot SET anything.
I figure, thats alright, I can just use a List. This way I can determine how much data from this List I would like to display at a time.
This works perfectly when pasting the data into a Text object, but it seems that I cannot place List in a table -at all- as data; it only accepts other tables. (Due to formatting?)

So now I was hoping to get some community feedback, perhaps I am overlooking an Action block or there might be a less convoluted way to do this.

In the attachments I have placed my screenshots + an ideal block, but I dont expect that this block will start existing in the next week emoticon
Any or all help would be appriciated!
0 (0 Votos)

RE: Filling table with variable list data
Resposta
06/09/22 10:47 em resposta a Daniel de Ridder.
Hi Daniel,

Before attempting to provide a solution, I think we need to clarify what you're trying to achieve.

Our assumption is that the author places the data off the page using a simple text object. For example:

Voornaam,Achternaam,Leeftijd
Kees,de Boer,25
Klaas,Flink,12
Geert,Roadster,56
etc.


Is this correct? And there might be many rows? (in this example, each row contains a person's first,last name, age)


Then for the display to the learner, do you want to:

  1. Display each row, one-at-a-time, with a slight delay so that the table builds up from top to bottom, rather than appearing all at once?
  2. Or, display just a chosen subset of rows? For example, if the data set contains 100 rows, maybe you just want to display the first 11 rows?
  3. Or both A and B?
  4. Or something else?
Thanks
0 (0 Votos)

RE: Filling table with variable list data
Resposta
06/09/22 14:23 em resposta a Rob Penn.
Hello Rob, thank you for your reply.
In the ideal world, our colleagues would fill an offscreen table with data. This data would be transfered into an onscreen table when the End User runs the course, preferably row by row with a slight time delay.
There is a variable number of rows, depending on the data of the offscreen table. This usually varries between 3 to 10 rows total.

As for your numbered list,
I have perhaps overcomplicated my screenshots, leaving in the various attempts I made thusfar. 
Option 1 would be the desired result, thank you.
0 (0 Votos)

RE: Filling table with variable list data
Resposta
06/09/22 19:44 em resposta a Daniel de Ridder.
Hi Daniel,

Thanks for clarifying your objective. The attached sample sb4 and screen shot below show how you can do this. The first page uses a table as the source of the data. The second page uses very similar actions but uses a  text object with comma separated values (CSV) instead of a table as the data source. I included this because it would probably be faster and easier for your authors to enter the text in a CSV format than in a table object.

As you can see in the actions, you can fine tune the speed at which the rows appear by typing a different value in the "wait for x seconds" block. Also, in the example, the trigger to show the table is a button click, but of course you could make this whatever you want, e.g., onPageLoad, etc.

Hopefully this answers your question, but let us know if not!
0 (0 Votos)

RE: Filling table with variable list data
Resposta
07/09/22 08:43 em resposta a Rob Penn.
Hello Rob, thank you for this excellent example.
I have managed to re-tool it into our project and I think it will be very easy to work with for our team.

One thing I was wondering, but could not figure out via trial and error:
Is it possible to manipulate this data in the process? Speaking strictly from the Table to Table example.

For example, if I wanted to add a default value in front of every row such as an ID number, that I dont want my colleagues to worry about when filling in the tables, but should get displayed in the end result?
I have attempted to add this to the Action block "Add items to list" as a third String variable in various ways, but without any success.


I figure I`ll have to break up the global Variable first, add the content I want before repacking it into a List Variable again, but I can`t figure it out in a way that the Table accepts the data.
Thanks again!
0 (0 Votos)

RE: Filling table with variable list data
variables arrays table lists
Resposta
07/09/22 15:02 em resposta a Daniel de Ridder.
Hi Daniel,

You're welcome! Yes this is possible. Normally, this would be quite easy to do, but we discovered that the "insert list item" block is not working properly. We'll get this fixed in the next update. 

In the  meantime there is a workaround, it's just a bit more complex. I have attached an example that you can use. Hopefully you can follow the logic in the blocks, but let me know if you have any questions.

Kind regards,

Rob
+1 (1 Votar)