Skip to content
Discussions/App Development/Data type inside list in a templateForum ↗

Data type inside list in a template

App Development5 posts357 viewsLast activity Jul 2022
JO
joao_santosOP
Jul 2022

Hello.

I am struggling to understand why can I not create a list of courses inside my template as an attribute.
Screenshot 2022-07-18 at 00.13.51

CO
cocreature
Jul 2022

Hi @joao_santos and welcome to the forum!

Can you share a bit more of your code? I suspect the error isn’t quite in the lines you showed. I tried compiling the following locally and it works without any issues on SDK 2.3:

module Main where

data Course = Course
  with
    subject : Decimal
    price : Decimal
  deriving (Show, Eq)

template Exlainer
  with
    name : Party
    courses : [Course]
  where
    signatory name
ST
Stephen
Jul 2022

Additionally, in general on this forum, please share code and error messages as text instead of screenshots using ``` above and below, as explained in this post.

JO
joao_santos
Jul 2022

I figured out what the error was.

In the respective choice I was doing:

let courses = delete courses parameter

And it was not possible

JO
joao_santos
Jul 2022

Thank you! Will do it next time

← Back to Discussions