Skip to content

How to use a note in a task #2272

Answered by jan-molak
tfarrar asked this question in How to... ?
Mar 8, 2024 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

Your approach makes sense, and the implementation is almost correct.

It looks like the task is reading the note as -- <>.as(String)

That's right, as notes().get(name) returns a dynamic Question which needs to be resolved by an Actor.
Calling notes().get('id').toString() returns a description of the Question object rather than its value.

Similarly, calling notes().get('id').as(String).toString() will chain a transformation as(String) to a dynamic value of notes().get('id'), and then .toString() returns the description rather than the value.

I'd suggest making the following improvements:

  1. Use an interface to define the structure of your notes
  2. Use Answerable<string> instead of just string

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@lostdog19
Comment options

@jan-molak
Comment options

@lostdog19
Comment options

Answer selected by jan-molak
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants