Strange problem apparently related to field name (?)

37 views
Skip to first unread message

Erwan

unread,
Dec 31, 2020, 7:40:07 AM12/31/20
to TiddlyWiki
Hi everyone,

I'm trying to generate a tiddler for a question together with several tiddlers for possible answers, see simplified code below. The link between the question and the answers is done with a field 'questionNo'.

The code below is supposed to print every question followed by the answers which have the same 'questionNo'. The last part doesn't work for some reason, but I discovered that when the field name 'questionNo' is replaced with 'no' everywhere then it works correctly.

So I solved my problem but I didn't understand what's happening with this field name. I would be very grateful if somebody can explain it to me :)

Regards,
Erwan

<$button>
DEL
<$action-deletetiddler $filter="[prefix[$:/temp/game/questions/q]] [prefix[$:/temp/game/candidate-answers]]"/>
</$button>
<$button>
Generate question and answers

  <$list filter="[prefix[$:/temp/game/questions/q]count[]add[1]]" variable="no">
    <$action-createtiddler $basetitle="$:/temp/game/questions/q" questionNo=<<no>>/>
    <$list filter="A B C D">
        <$action-createtiddler $basetitle="$:/temp/game/candidate-answers" questionNo=<<no>> text=<<currentTiddler>>/>
     </$list>
  </$list>
</$button>

<$list filter="[prefix[$:/temp/game/questions/q]]">

  question title="{{!!title}}", questionNo="{{!!questionNo}}"

<$list filter="[prefix[$:/temp/game/candidate-answers]questionNo{!!questionNo}]">

  {{!!title}}
</$list>

</$list>

Saq Imtiaz

unread,
Dec 31, 2020, 7:42:10 AM12/31/20
to TiddlyWiki
Field names can only be lowercase. So when you create a field called questionNo it is automatically converted to questionno. You could also use question_no

Erwan

unread,
Dec 31, 2020, 7:58:53 AM12/31/20
to TiddlyWiki

Oh ok, I didn't even think of that... thank you very much for your answer Saq!

Erwan
Reply all
Reply to author
Forward
0 new messages