Multi-choice question object type

Hi All,
Is there any way to have the request via api of multiple responses in object format and not in list format?

I am using this end-point


@sowe, could you also let the community know the objective behind this? The community should then be able to help you out.

Hi @Kal_Lam
My objective is to know if within the koboo api we have a way to send the answers that are of multiple type in object format and not as a list. Maybe with a newer version of the api or using some parameter. :man_shrugging:

type list
Field : Field_1 Field_2 Field_3 Field_4

type object:
Field [
Field_1: 1,
Field_2: 0
Field_3: 1
Field_4 : 0

Hi Sowe, is there any specific reason you want to send it as object?

1 Like

Hi! @osmanburcu
For example, when trying to process a list in powerbi many steps are needed, but with the powerbi object the columns are read automatically.

For Power PI, You can solve it with two septs. You can split column and unpivot the column. It will be short and more straightforward than trying to do it in Kobo.

Hi @osmanburcu ,
Thanks for your answer. I see your point but I disagree because we need three steps for each field. And if you have a lot of multiple-choice the performance is low.
In my opinion the steps are :

  1. Chek if this value is null ( When we do the pivot it gives error with null values.)
  2. List key value with label
  3. Split column by row with space
  4. Duplicate column
  5. Pivot the column
  6. Remove the null column (optional)

#“sample3IsNull” = Table.TransformColumns(#“Removed Columns food3”, {“sample/sample3”, each if _ is null then “Null” else }),
#“AllReplacesample3” =[
#“sample1”="Lorem ",
#“sample2”="ipsum ",
#“sample3”="dolor ",
#“sample4”=“sit amet],
#“Split Column by Delimiter1 sample3” = Table.ExpandListColumn(Table.TransformColumns(sample3IsNull, {{“sample/sample3”, Splitter.SplitTextByDelimiter(” ", QuoteStyle.Csv), let itemType = (type nullable text) meta [Serialized.Text = true] in type {itemType}}}), “sample/sample3”),
#“Replaced sample3” = Table.TransformColumns(#“Split Column by Delimiter1 sample3”,{{“sample/sample3”,each Record.FieldOrDefault(AllReplacesample3,
#“Duplicated sample3” = Table.DuplicateColumn(#“Replaced sample3”, “sample/sample3”, “sample/sample3 - Copy”),
#“Pivoted Column sample3” = Table.Pivot(#“Duplicated sample3”, List.Distinct(#“Duplicated sample3”[#“sample/sample3 - Copy”]), “sample/sample3”, “sample/sample3 - Copy”, List.Count),
#“Removed Columns sample3” = Table.RemoveColumns(#“Pivoted Column sample3”,{“Null”})