plutov / formulosity

Self-hosted Surveys as Code platform.
https://formulosity.vercel.app
MIT License
181 stars 20 forks source link

Pipe answers to other questions #9

Open plutov opened 3 months ago

plutov commented 3 months ago

Start simple: with options questions. Pipe selected options of one questions to become options of another question.

anveshthakur commented 1 month ago

Can I take this up @plutov?

plutov commented 1 month ago

@anveshthakur sure, this one needs a good design so it can be scaled later.

anveshthakur commented 1 month ago

I will come up with something first and let you know.

anveshthakur commented 1 month ago

hi @plutov, I am thinking of something like this

- type: short-text
  label: What country you wanna travel?
  name: askCountry
- type: short-text
  label: What is the capital of ${askCountry}?

So basically -

  1. Assign this name property to the question in YAML file and then reference it using the name property
  2. Frontend will be responsible for inserting the answer in the template string
  3. In that case once we get the answer for 1 question we can check which question has that name and can fetch the answer for it?

It is a very rough Idea though as of now..

let me know what do you think about it?