``` incomes: HOURLY_SALARY_BASE_WAGE_INCOME: ...
# announcements
s
Copy code
incomes:
    HOURLY_SALARY_BASE_WAGE_INCOME:
    - types: "PAYSTUB"
    - types: "W2"
a
I wonder if this has to do with the group by performing the mapof step for each grouping. Because when I try your code standalone (I wanted to test this), it works fine:
Copy code
val typesList = listOf("W2", "Paystub")
    val map: Map<String, List<String>> = mapOf("types" to typesList)
    println(map) // {types=[W2, Paystub]}
Idk the way around this yet but felt like throwing this note out there if someone can pick up my train of thought lmao
l
try something like
.mapValuesTo
this will probably mach each
key
to a value value of
types
s
@leosan I tried
mapValues {}
but that maps the entire key as well.
Copy code
OTHER:
      types:
        OTHER:
        - "LETTER_OF_EXPLANATION"
        - "APPLICANT_FINANCIAL_STATEMENT"
🤔 1
but it's close to what I want.
Ok @leosan that worked, I used mapValues wrong
val assets = assetValues.drop(1).groupBy({ it[assetEnumCol] }, { it[assetDocCol]}).mapValues { mapOf("types" to it.value) }
👏 1
final code.
a bit messy, but it works! thanks!
l
just give them better names and it's fine 😛
a
go team.