2 Lists to 1 Output

Hey Blazers! I have an interesting challenge before me that I bet is actually pretty simple to execute. I have a snippet containing 2 formmenus Each formmenu contains different items. I need the user to only be able to select 1 items from either formmenu, then pass that selection to a variable. The key is, if the user selects an item from either formmenu, then selects an item from the other formmenu, it takes the place of the original selection. Take a look at my snippet so far:

{note: preview=no; insert=no}
Variables:
{`today+1`={time: M/D; shift=+1D}}
{`today+2`={time: M/D; shift=+2D}}

Sequence 1: Makes Case Status as "New". Saves case.
Sequence 2: Makes Case Status as "New". Saves case. Changes Case Owner to "JP".
Sequence 3: Makes Case Status as "New". Brings cursor back to Case Description. Leaves case open for editing.
Sequence 4: Makes Case Status as "Closed". Saves case.
Sequence 5: Makes Case Status as "New". Saves case. Changes Case Owner to "JP". Reopens case for editing.

{items1=[["name":"Please Select"],["name":"("&{=`today+2`}&" Drop)", "sequence": 1],
["name":"("&{=`today+2`}&" TOR Pending)", "sequence": 1],
["name":"("&{=`today+2`}&" Drop Vol W)", "sequence": 1],
["name":"("&{=`today+2`}&" Drop Vol W - Confirmed)", "sequence": 2],
["name":"(Drop Confirmed)", "sequence": 2],
["name":"("&{=`today+2`}&" Re-Entry Grad Drop)", "sequence": 3],
["name":"("&{=`today+2`}&" TOR Pending/Re-Entry Grad)", "sequence": 3],
["name":"("&{=`today+2`}&" Drop - VA)", "sequence": 1],
["name":"("&{=`today+2`}&" TOR Pending - VA)", "sequence": 1],
["name":"("&{=`today+2`}&" Re-Entry Grad Drop - VA)", "sequence": 3],
["name":"("&{=`today+2`}&" TOR Pending/Re-Entry Grad - VA)", "sequence": 3],
["name":"("&{=`today+2`}&" TOR - DENIED)", "sequence": 1],
["name":"SAT REVIEW ("&{=`today+2`}&" TOR Pending)", "sequence": 1],
["name":"(DP - Participated)", "sequence": 4],
["name":"(DP - TOR Approved)", "sequence": 5]]}
{sequence=filter(items1, item -> item.name == subjectselection1)[1].sequence}

{items2=[["name":"Please Select"],["name":"("&{=`today+2`}&" Drop - DNR)", "sequence": 1],
["name":"("&{=`today+2`}&" TOR Pending - DNR)", "sequence": 1],
["name":"("&{=`today+2`}&" Drop Vol W - DNR)", "sequence": 1],
["name":"("&{=`today+2`}&" Drop Vol W - Confirmed - DNR)", "sequence": 2],
["name":"(Drop Confirmed - DNR)", "sequence": 2],
["name":"("&{=`today+2`}&" Re-Entry Grad Drop - DNR)", "sequence": 3],
["name":"("&{=`today+2`}&" TOR Pending/Re-Entry Grad - DNR)", "sequence": 3],
["name":"("&{=`today+2`}&" Drop - DNR - VA)", "sequence": 1],
["name":"("&{=`today+2`}&" TOR Pending - DNR - VA)", "sequence": 1],
["name":"("&{=`today+2`}&" Re-Entry Grad Drop - DNR - VA)", "sequence": 3],
["name":"("&{=`today+2`}&" TOR Pending/Re-Entry Grad - DNR - VA)", "sequence": 3]]}
{sequence=filter(items2, item -> item.name == subjectselection2)[1].sequence}

{if: {=subjectselection1}=="Please Select"}{=subjectselection2}{endif}
{if: {=subjectselection2}=="Please Select"}{=subjectselection1}{endif}

{output={=subjectselection1}}
{output={=subjectselection2}}

{=output}
{endnote}

Choose A New Subject Line For This 21-Day MIA Review Case

{note: insert=no; preview=yes; trim=right}
Standard Drop Options:
{formmenu: values={=map(items1, item->item.name)}; name=subjectselection1; cols=36} 21-Day MIA Review

DNR Options:
{formmenu: values={=map(items2, item->item.name)}; name=subjectselection2; cols=36} 21-Day MIA Review{endnote}

Your New Subject Line will be: {=output} 21-Day MIA Review

Hey Brad,

I think that this is what you're asking for, but it's still not quite perfect.

I removed the two {output=...} assignments and updated the {if} statements before those.

The reason that it's not perfect is the same reason why the mutually-exclusive checkboxes aren't perfect, where if you select a second value you actually have to select it twice. Curious if anyone has a better solution than that.

{note: preview=no; insert=no}
Variables:
{`today+1`={time: M/D; shift=+1D}}
{`today+2`={time: M/D; shift=+2D}}

Sequence 1: Makes Case Status as "New". Saves case.
Sequence 2: Makes Case Status as "New". Saves case. Changes Case Owner to "JP".
Sequence 3: Makes Case Status as "New". Brings cursor back to Case Description. Leaves case open for editing.
Sequence 4: Makes Case Status as "Closed". Saves case.
Sequence 5: Makes Case Status as "New". Saves case. Changes Case Owner to "JP". Reopens case for editing.

{items1=[["name":"Please Select"],["name":"("&{=`today+2`}&" Drop)", "sequence": 1],
["name":"("&{=`today+2`}&" TOR Pending)", "sequence": 1],
["name":"("&{=`today+2`}&" Drop Vol W)", "sequence": 1],
["name":"("&{=`today+2`}&" Drop Vol W - Confirmed)", "sequence": 2],
["name":"(Drop Confirmed)", "sequence": 2],
["name":"("&{=`today+2`}&" Re-Entry Grad Drop)", "sequence": 3],
["name":"("&{=`today+2`}&" TOR Pending/Re-Entry Grad)", "sequence": 3],
["name":"("&{=`today+2`}&" Drop - VA)", "sequence": 1],
["name":"("&{=`today+2`}&" TOR Pending - VA)", "sequence": 1],
["name":"("&{=`today+2`}&" Re-Entry Grad Drop - VA)", "sequence": 3],
["name":"("&{=`today+2`}&" TOR Pending/Re-Entry Grad - VA)", "sequence": 3],
["name":"("&{=`today+2`}&" TOR - DENIED)", "sequence": 1],
["name":"SAT REVIEW ("&{=`today+2`}&" TOR Pending)", "sequence": 1],
["name":"(DP - Participated)", "sequence": 4],
["name":"(DP - TOR Approved)", "sequence": 5]]}
{sequence=filter(items1, item -> item.name == subjectselection1)[1].sequence}

{items2=[["name":"Please Select"],["name":"("&{=`today+2`}&" Drop - DNR)", "sequence": 1],
["name":"("&{=`today+2`}&" TOR Pending - DNR)", "sequence": 1],
["name":"("&{=`today+2`}&" Drop Vol W - DNR)", "sequence": 1],
["name":"("&{=`today+2`}&" Drop Vol W - Confirmed - DNR)", "sequence": 2],
["name":"(Drop Confirmed - DNR)", "sequence": 2],
["name":"("&{=`today+2`}&" Re-Entry Grad Drop - DNR)", "sequence": 3],
["name":"("&{=`today+2`}&" TOR Pending/Re-Entry Grad - DNR)", "sequence": 3],
["name":"("&{=`today+2`}&" Drop - DNR - VA)", "sequence": 1],
["name":"("&{=`today+2`}&" TOR Pending - DNR - VA)", "sequence": 1],
["name":"("&{=`today+2`}&" Re-Entry Grad Drop - DNR - VA)", "sequence": 3],
["name":"("&{=`today+2`}&" TOR Pending/Re-Entry Grad - DNR - VA)", "sequence": 3]]}
{sequence=filter(items2, item -> item.name == subjectselection2)[1].sequence}

{if: {=subjectselection2}<>"Please Select"}{subjectselection1="Please Select"}{endif}
{if: {=subjectselection1}<>"Please Select"}{subjectselection2="Please Select"}{endif}
{if: {=subjectselection1}=="Please Select"}{output=subjectselection2}{endif}
{if: {=subjectselection2}=="Please Select"}{output=subjectselection1}{endif}

{endnote}

Choose A New Subject Line For This 21-Day MIA Review Case

{note: insert=no; preview=yes; trim=right}
Standard Drop Options:
{formmenu: values={=map(items1, item->item.name)}; name=subjectselection1; cols=36} 21-Day MIA Review

DNR Options:
{formmenu: values={=map(items2, item->item.name)}; name=subjectselection2; cols=36} 21-Day MIA Review{endnote}

Your New Subject Line will be: {=output} 21-Day MIA Review

2 Likes

This is awesome @Andrew_Hall - Thank you! I see what you mean about having to make the 2nd selection twice. I wonder how to overcome that. @Gaurang_Tandon @Cedric_Debono_Blaze You fellas have any ideas?

I spent some time trying to implement something similar to One option only - #3 by Mansur_Kutybayev but I could not get that to work here :confused:

Hi @Brad_Hedinger,

Is this what you are looking for?

{selected=""}

{formmenu: Choice A; Choice B; Choice C; default=; name=forma}
{formmenu: Choice D; Choice E; Choice F; default=; name=formb}

{if: forma <> "" and formb <> ""}
{if: selected == forma}
{forma=""}
{selected=formb}
{endif}

{if: selected == formb}
{formb=""}
{selected=forma}
{endif}
{elseif: forma <> ""}
{selected=forma}
{elseif: formb <> ""}
{selected=formb}
{endif}
{=selected}

3 Likes

Yes! Thank you @Mansur_Kutybayev! I had to do a little tweaking because it would not work when adapting my list items into it. But, found the resolve by adding a new "Sequence 0" that does nothing. This enabled the blank item to work. Thank you!!