Hello everyone,
I work on a team of academic advisors at a community college, and our most frequent communication with students is about deadlines and other date information. I'm trying to create a general "important date" snippet that allows users to pull rows of terms from Datablaze and then select/toggle the specific columns (dates) they want to include. This would be game-changing for our team because it would allow us to create a single snipper we can then import into other snippets while also eliminating the search for deadline information.
Example: The terms table has registration, refund, and financial aid dates. Depending on the question, multiple dates from multiple rows could apply to the student, and each date is different. I'd like my advisor to pick which rows (20 week, 16 week, and last start) and dates (registration closes & 100% refund deadline) based on the student's question. Ignoring the terms and dates we didn't want.
Can anyone think of a fast way to basically allow users to select which columns from multiple rows they want?
Hi @COREY_CHARLE, welcome back to the forum. 
You can use a formmenu with a value set to the keys of the data in the row you fetched as follows:
{dbselect: SELECT Name, registration, refund, `financial aid` FROM terms; space=4IKnoNbEfMkTAVWSfEsZsC; menu=yes; name=data; multiple=no}
{if: data <> ""}
{formmenu: values={=keys(data)}; multiple=yes; name=selection}
{endif}
{repeat: for x in selection}
{=x}: {=data{{^^%5Bx%5D^^}}}
{endrepeat}
Please let me know if that helps.
Not quite. I was hoping for something that would allow a table to develop. Not necessarily a list. I see that rows have conditions to appear, but I was hoping for a way to get similar functionality for columns.
@COREY_CHARLE Unfortunately, there's nothing like conditional column selection (projection) in BSQL. In addition, we don't support approaches like "dynamic queries" in Text Blaze for security reasons. However, if I understand correctly, then I believe you can still follow the approach I presented in your master snippet, and since you'll be importing it later into other snippets, you can keep updating the master snippet query with the new columns as the table develops, then let the sub-snippets select which columns to present in the final snippet. What do you think?
Just confirming that there are no conditional columns gives me a direction to run. I'm positive we can find a way to select and present the information that will work for communication. I'm gonna give some things a try and see where we can get. Thank you so much for your help!
1 Like