Objective: Populate a markdown field using a Lookup & Set Value rule
Problem: Markdown field is only populated with one color's instructions and does not populate instructions from the remaining selected colors.
Question: Is there a way to populate the markdown field with each selected color's instructions?
Setup:
Form One has the following fields:
Form Two has the following fields:
Form Two has a field definition rule configured as:
Hi
Multi-value fields as arguments in filters are a bit tricky - as you need to construct a filter dynamically
Here is how it is possible - see the screencast below
With storage format for the reference
<ac:structured-macro ac:name="confiform" ac:schema-version="1" ac:macro-id="2a1e65d3-3cb0-4384-b470-5e7ee66a86e6"><ac:parameter ac:name="hideAdminUI">true</ac:parameter><ac:parameter ac:name="formName">formOne</ac:parameter><ac:rich-text-body> <p><ac:structured-macro ac:name="confiform-field-definition" ac:schema-version="1" ac:macro-id="3a4af94b-d006-4111-af6a-e33beff920fb"><ac:parameter ac:name="fieldName">color</ac:parameter><ac:parameter ac:name="type">text</ac:parameter><ac:parameter ac:name="macroHash">1218298903</ac:parameter></ac:structured-macro></p> <p><ac:structured-macro ac:name="confiform-field-definition" ac:schema-version="1" ac:macro-id="cf1d9745-7f5e-4d8a-a6e2-a58d0f018887"><ac:parameter ac:name="fieldName">colorInstructions</ac:parameter><ac:parameter ac:name="type">markdown</ac:parameter><ac:parameter ac:name="macroHash">265096862</ac:parameter></ac:structured-macro></p><ac:structured-macro ac:name="confiform-entry-register" ac:schema-version="1" ac:macro-id="45cf2744-dd15-400e-8e4f-b6bfb0cf122d"><ac:parameter ac:name="formName">formOne</ac:parameter><ac:rich-text-body> <p><br /></p></ac:rich-text-body></ac:structured-macro> <p class="auto-cursor-target"><br /></p></ac:rich-text-body></ac:structured-macro> <p class="auto-cursor-target">Available colors</p><ac:structured-macro ac:name="confiform-table" ac:schema-version="1" ac:macro-id="ca7e5227-5903-448f-a277-e48a3905add3"><ac:parameter ac:name="formName">formOne</ac:parameter><ac:rich-text-body> <p><br /></p></ac:rich-text-body></ac:structured-macro> <p class="auto-cursor-target"><br /></p> <p><br /></p><ac:structured-macro ac:name="confiform" ac:schema-version="1" ac:macro-id="543c7323-852d-4732-89a4-7981c6fb8ac2"><ac:parameter ac:name="hideAdminUI">true</ac:parameter><ac:parameter ac:name="formName">formTwo</ac:parameter><ac:rich-text-body> <p><ac:structured-macro ac:name="confiform-field-definition" ac:schema-version="1" ac:macro-id="e87e39b8-6e3e-4ab8-b43c-893d04f5da09"><ac:parameter ac:name="fieldName">myColorSelection</ac:parameter><ac:parameter ac:name="values">[1508966425|formOne|color|true||]</ac:parameter><ac:parameter ac:name="type">smartmultiselect</ac:parameter><ac:parameter ac:name="macroHash">460968723</ac:parameter></ac:structured-macro></p> <p><ac:structured-macro ac:name="confiform-field-definition" ac:schema-version="1" ac:macro-id="874eb52e-f139-4f8c-a9b8-44e556cf46eb"><ac:parameter ac:name="fieldName">myInstructions</ac:parameter><ac:parameter ac:name="type">markdown</ac:parameter><ac:parameter ac:name="macroHash">1238172543</ac:parameter></ac:structured-macro></p> <p><br /></p> <p>-- rule</p> <p><ac:structured-macro ac:name="confiform-field-definition-rules" ac:schema-version="1" ac:macro-id="1f04ff9c-ad2e-4363-ac39-be6cb1cfb1d3"><ac:parameter ac:name="condition">!myColorSelection:[empty]</ac:parameter><ac:parameter ac:name="fieldName">myInstructions=[entry.colorInstructions.append(\n\n)]</ac:parameter><ac:parameter ac:name="values">id:[entry.myColorSelection.transform(id).join( OR id:)]</ac:parameter><ac:parameter ac:name="action">Lookup and set value</ac:parameter><ac:parameter ac:name="actionFieldName">myColorSelection</ac:parameter><ac:parameter ac:name="values2">formOne</ac:parameter><ac:parameter ac:name="macroHash">-505735227</ac:parameter></ac:structured-macro></p> <p><ac:structured-macro ac:name="confiform-field-definition-rules" ac:schema-version="1" ac:macro-id="648bea34-dc68-4d34-a6ad-2df74b6743cb"><ac:parameter ac:name="condition">myColorSelection:[empty]</ac:parameter><ac:parameter ac:name="fieldName">myInstructions</ac:parameter><ac:parameter ac:name="action">Reset value</ac:parameter><ac:parameter ac:name="actionFieldName">myColorSelection</ac:parameter><ac:parameter ac:name="macroHash">1378536391</ac:parameter></ac:structured-macro></p> <p><br /></p> <p class="auto-cursor-target"><br /></p></ac:rich-text-body></ac:structured-macro> <p class="auto-cursor-target"><br /></p><ac:structured-macro ac:name="confiform-entry-register" ac:schema-version="1" ac:macro-id="ba197809-af25-4d58-b8b2-7a6f0e197d4b"><ac:parameter ac:name="formName">formTwo</ac:parameter><ac:rich-text-body> <p><br /></p></ac:rich-text-body></ac:structured-macro>
I use the "join" and "transform" functions to get arguments (field values I need) right
https://wiki.vertuna.com/display/CONFIFORMS/Virtual+functions
As with all the ConfiForms smart fields the filtering is done using the UUIDs of the records (as this is what they store - a link to the record, that is why I check against the "id" field in the formOne in my "lookup filter")
Hope it helps
Alex
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Alex, thank you! You definitely got me past a mental wall on this. I did have to tweak it to fit my particular needs. I just wanted to populate the myInstructions field ONLY if the option selected contained the word "blue":
Rule #1: If myColorSelection has less than 2 options selected that start with blue then lookup and set value. (I had to do a separate rule for 1 option because the .append(\r\r) would not work correctly for a single selection)
Rule #2: If myColorSelection has more than 1 option selected that start with blue then lookup and set value. (I had to do a separate rule for 1 option because the .append(\r\r) would not work correctly for a single selection)
Rule #3: If myColorSelection is empty then reset value.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The sample video is no longer available and I am trying to do something similar, any where I can view the video?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Really nothing much to show in the demo... but here it is
Hope it helps
Alex
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.