25
Views
7
Comments
Solved
Editable Table

Hi All,

I am developing an app where I need the editable table. The main purpose of the app is for users to answer questions. Because some questions are consistent of mulitple categories I want to create a table so the users can fill in their answers easily. 

The problem I am facing is the fact that there are multiple questions that require a table, and they all should have different columns. I have tried creating a part of my upload (the users are able to upload and excel with their questions, the type and the answers etc) and connect the 'Header Values' to a specific questionId. This is working for every page where there is only 1 table. If the page has two or more tables only the first is rendered correctly. 

In advance, the input variables inside the tables body should also be different based on the headers that are showing since I need to know to which column (question) the answer was given. 

If anybody has any ideas on how to do this, please let me know!

Thanks,

Max

Rank: #136
Solution

Hi Max,

as Einstein said :

“If I had an hour to solve a problem and my life depended on the solution, I would spend the first 55 minutes determining the proper question to ask… for once I know the proper question, I could solve the problem in less than five minutes.” 

glad to somehow have been of help,

Dorine

Rank: #136

Hi Max,

can you maybe share an oml or some screenprints with what you are trying to do, it sounds all very confusing to me.  For example, where do the users get the excel to fill in, from your page ??  Why use an excel, can't you just let them fill in on an outsystems screen ?  What does your datamodel look like ? 


Dorine

Rank: #11128

Hi Dorine,
I can't share the oml due to company restrictions.


The table I am creating needs to look like this. This table is inside its own webblock which is inside a listrecord in another webblock. This way OutSystems can loop trough all the questions. The Excel file with questions is uploaded by a 'Maintainer' and contains all questions that need to be answered. The logic used is the excel to record list. I have created tables in my excel where I define the header text of the table (that should be visible inside the Expression below. To get these header text I am using the loop and switch statement as shown in screenshot. My Question Data model has attributes for QuestionText, TypeId, TopicId and the position. The AnswerTable has a FK to the QuestionTable and I have connected my TableHeader table to the question ID. This all works fine with getting the right type and putting data in the table headers. But when I need more tables on 1 page it is not working for more than 1. The assign statements are all connected to a Local Variable which are the input values of the Expression. 

Rank: #136

Ok,

i think I understand, the excel is what you use to upload the structure of your questions, with a number of categories under one and the same question.

The actual answering of the questions happens on a screen, and there, if more than one question with a table of categories is on the same page, only the first gets displayed correctly ?  What happens with the others, wrong headers, no headers at all, exception, ... ?


EDIT : if I understand correctly, the fact that they were uploaded from excel doesn't play a role in your problem ?  When you look in the database after the 'Maintainer' has run, it looks fine ?

Rank: #136

Ok,

so the logic you are showing earlier, I guess that's inside the preparation of the webblock, right ?  So the webblock has an input of QuestionID, and then retrieves all tableheaders from the database that are part of that question, and then executes your switch, right ?

And what are you passing into the webblock from your screen?  Maybe it would help to put your webblock inputs as expressions on the webblock canvas for now and see if each instance of the webblock gets the correct input.  If so, maybe also put a tablerecords on canvas of webblock temporarily, displaying the result of the GetTableHeaders aggregate.

Since one instance of the webblock displays fine, and all others not, I would expect something wrong with what you are passing into it.

Rank: #136
Solution

Hi Max,

as Einstein said :

“If I had an hour to solve a problem and my life depended on the solution, I would spend the first 55 minutes determining the proper question to ask… for once I know the proper question, I could solve the problem in less than five minutes.” 

glad to somehow have been of help,

Dorine