Drag/Drop options

Does any one know if there is a feature to drag values up and down? For example, if you have different strengths of prescriptions (10 mg, 20 mg, 30 mg), and you want to add 15 mg. The only option I can see is to add another value at the bottom but then it is out-of-order.


Could you share the code with the issue that you're having?

It's not really a bug. I was wondering if there is a way to re-organize the values without deleting them.

It would help to see the code to see what you're working with and what you're trying to achieve.

Hi @Chris_Walters - welcome to the forum.

Here's one way to do it:

{note: trim=right}
{list=[7, 2,4, 9, 5]}
{sorted=sort(list, (a, b) -> a - b)}
{endnote: trim=right}

{formmenu: values={=sorted}}

The numbers in the first list will show up on the menu sorted numerically, regardless of how they're added in the list.

Sorry. I am a noob at formatting. I am trying to numerically sort this:

Hi @Chris_Walters - no worries at all. We all started from zero :slight_smile:

The snippet I shared with you only works for sorting numerical lists. Sorting alphabetically is done a little differently (though it's a similar concept).

Here's how I would do it:

{note: trim=right}
{EHS_score_list=sort([0, 1, 2, 3, 4], (a, b) -> a - b)}
{medication_list=sort(["Generic Viagra", "Sildenafil", "Cialis", "Tadalafil", "Branded Viagra", "Stendra"], (a, b) -> comparestrings(a, b))}
{dosage_list=sort([5, 10, 20, 25, 40, 50, 60, 80, 100], (a, b) -> a - b)}

{endnote: trim=right}

Symptoms consistent with ED. EHS of {formmenu: cols=5; values={=EHS_score_list}}. Denies chest pain or SOB. No c/i to treatment.
Will start {formmenu: name=Medication; default=Generic Viagra; values={=medication_list}} {formmenu: cols=7; default=50; values={=dosage_list}} mg {formmenu: name=Frequency; default=as-needed; daily}. Follow up in {formtext: default=3; cols=5} months.

So, first I created the lists at the very top and assigned them to variables (labels). Then I used those variable names inside my formmenu commands.

Let me know if anything is unclear and I'll be happy to get into more detail :slight_smile:

By the way, you can copy my snippet directly into the dashboard by clicking on the "Copy to Text Blaze" button in the top right of the snippet window.

Thank you so much! I have 2 more to do like this. I'll try it out.

@Chris_Walters - cool, glad this helped :slight_smile:

Jump in and ask questions anytime!

Hi @Chris_Walters - saw your message but the PM functionality in this forum is a bit problematic. Shoot me an email on cedric@blaze.today and let's jump on a call. That way, I can help you build the snippets and also explain the logic behind the workflow :slight_smile: