Scripting help on how to generate the Row Index of Multi Row Question Answers table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2019 12:49 AM
Hi Everyone,
I am trying to insert rows in table “Multi Row Question Answers” (sc_multi_row_question_answer) using business rule against RITM record.
But I am not sure how Row index(Field in sc_multi_row_question_answer table) number gets generated?
Can anyone please assist me ? how should I generate row index using script so I will able to populate Multi Row Question Answers on RITM view under variable editor ?
- Labels:
-
Integrations
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2019 05:36 PM
Have you tried not populating it and checking the results? I would try that first.
Other wise I would assume that the row index is the order in which the questions are displayed, top to bottom, in which case you can number them as you wish.
You could do it dynamically with a script by querying the questions against RITM, ordering by row index, finding the largest row index, then inserting your new question with an index 1 greater than the returned result, that would always put the new question at the bottom of the list.
Cheers,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2021 10:23 AM
Did you found a way to generate row indexes by any chance?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2022 02:39 AM
I am using this way to generate a "random" row index
var n= 999999999999999; // Outbound Limit
var rowIndex = Math.floor(Math.random() * n);