Closed NaruZosa closed 3 years ago
Sorry for the late reply, this got hidden in some other github notifications.
The multi-user
section isn't necessary at all. You will eventually need to write some information to the interview's database using store_variables_snapshot
, i.e. something like store_variables_snapshot(data={'zip': users[0].address.zip})
, but that shouldn't be necessary for this first step.
I think the problem you're having is that dispatch
is case sensitive: Dispatch
won't work. It is confusing, since the yaml in interviews isn't case sensitive, but the yaml in the config file seems to be.
And thanks for pointing the typo, that's easy to fix!
Thank you for your response Bryce.
No need to apologise, you've freely provided this tool and are assisting me. Thank you.
I've just attempted with a very simple form, but don't receive any results. The forms are however now listed with a message stating "What interview do you want to view statistics for?" and a dropdown to select the interview, so progress is being made. Once a form is selected and I click continue, I receive
"Stats for Untitled: 0 Total submissions: 0" Almost certain this is a case of PEBKAC
metadata:
title: |
PrefixMinMax
---
mandatory: True
question: |
Record Management
subquestion: |
What is the record number?
fields:
- Change ID: C1
hint: eg C123456
minlength: 7
maxlength: 8
validation messages:
minlength: |
Record numbers have at least 6 digits.
maxlength: |
Record numbers are at most 7 digits.
validation code: |
if not (str.upper(C1).startswith('C')):
validation_error("You need to enter a record number that starts with C.")
---
mandatory: True
code: |
store_variables_snapshot(data={'C1': C1})
---
What I'm attempting to do, is to store the variable C1. If store_variables_snapshot is called without any arguments, would that store all values and make it all viewable via docassemble.InterviewStats? That appears to be the case based on what I read on the docassemble wiki 'Functions' page but hope to confirm. I've attempted calling it with no arguments as well, but still see no results.
Configuration:
dispatch:
PrefixMinMax: docassemble.PrefixMinMax:data/questions/Prefix2.yml
At the end of the interview, I receive the expected message of
Docassemble has finished executing all code blocks marked as initial or mandatory, and finished asking all questions marked as mandatory (if any). It is a best practice to end your interview with a question that says goodbye and offers an Exit button.
History
Tried to run mandatory code at 0.00142s
mandatory: True
code: |
store_variables_snapshot()
I added the store_variables_snapshot line at the same time I added the metadata with the title, but strangely the title of the interview is still "Untitled" on both the interview list page, and the Available Interviews page. I tried saving the config file again which restarted the server, but still no change.
Unsure if that's related to this issue, and it may just not be respecting the changes (adding title and store_variables_snapshot).
Yep, a PEBKAC, and store_variables_snapshot() works brilliantly. I foolishly had the config pointing to the prod instance and had only made the changes to the Playground instance. Noticed immediately after considering how the title hadn't updated either.
Got results and everything is working swimmingly, thank you very much! This tool is such a fantastic contribution to the community, and I'm sure many others are also incredibly grateful for your generosity in sharing :)
Awesome! Glad you got it working. It's definitely still bare bones, but we'll definitely take another look at adding some more features and documentation soon-ish (meaning in the coming months)!
Hi there,
This seems like it would be incredibly useful! Sadly, I can't seem to get it working.
At the top of my interview I have
And at the bottom of my configuration file I added
I can access the interview from the dispatch name at docassemble.servername.com/start/dispatchname I'm not sure if there's anything else I need to change, but I'm assuming there's something simple I've overlooked and would be grateful if you could provide some guidance.
Also, there's a small typo on the no interviews message, it says to refer to the docassemble documentation for more "informatieon".
Thank you.