Skip to content

Commit

Permalink
Add support for rows in parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
grzesiek2010 committed Nov 21, 2023
1 parent a162a9e commit 7aaacf5
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions pyxform/xls2json.py
Original file line number Diff line number Diff line change
Expand Up @@ -1306,6 +1306,21 @@ def workbook_to_json(
parent_children_array.append(new_dict)
continue

if question_type == "text":
new_dict = row.copy()

if "rows" in parameters.keys():
try:
int(parameters["rows"])
except ValueError:
raise PyXFormError("Parameter rows must have an integer value.")

new_dict["control"] = new_dict.get("control", {})
new_dict["control"].update({"rows": parameters["rows"]})

parent_children_array.append(new_dict)
continue

if question_type == "photo":
new_dict = row.copy()

Expand Down

0 comments on commit 7aaacf5

Please sign in to comment.