Can't select field for Default Value field of "Create New Row(s)" action within "Action Sequence"

  • 1
  • Problem
  • Updated 7 months ago
  • Solved
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb

Posted 8 months ago

  • 1
Photo of Luzie Baumgart

Luzie Baumgart, Official Rep

  • 1,310 Points 1k badge 2x thumb
Thank you for the screenshot. Can you reproduce this issue after re-opening the page in the composer?

Looks like it was possible before to select "RecordTypeID" as field. I can reproduce the scenario shown in the screenshot if I do the following:

1. create a new action sequence
2. add the action "Create new row(s)"
3. select an existing model (which is listed in "Models" on the left below "Components")
4. add a default value, all model fields are available
5. go to tab "Inputs" and create a new input with type = model
6. go back to tab "Actions" and to action type "Create new row(s)"
7. change "Model" from existing model to the new model (input) that I created in step 5
8. add a default value and try to select a field

Now there are no fields available because the input model has no fields, yet. You should see fields if you go to "Inputs" of your action sequence and add input fields for your input model. If you did the latter and still see no fields, please let me know which version you are currently using. Could you please also share a screenshot of the "Inputs" tab?
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
The issue is seemingly only present when the default value is being set for a new row in an input model in an action sequence. The default value in the that was set in the provided screenshot was set before I converted to an Action Sequence.
Photo of Luzie Baumgart

Luzie Baumgart, Official Rep

  • 1,310 Points 1k badge 2x thumb
Hi Pat,
We are excited to see that you are using the new action sequence features in Millau. Sorry that you are running into issues. We want to make sure that the new features are easy to use. If you can reproduce this on a new page that only includes the necessary components and standard salesforce objects and fields, could you please paste the XML here? I'll be happy to investigate. 
(Edited)
Photo of Luzie Baumgart

Luzie Baumgart, Official Rep

  • 1,310 Points 1k badge 2x thumb
<skuidpage unsavedchangeswarning="yes" personalizationmode="server" showsidebar="false" useviewportmeta="true" showheader="false">
    <models>
        <model id="Task" query="false" createrowifnonefound="false" datasource="salesforce" sobject="Task">
            <fields>
                <field id="CallDurationInSeconds"/>
                <field id="Description"/>
            </fields>
            <conditions/>
            <actions/>
        </model>
    <model id="Account" query="false" createrowifnonefound="false" datasource="salesforce" sobject="Account">
<fields>
    <field id="RecordTypeId"/>
    <field id="Name"/>
</fields>
<conditions/>
<actions/>
</model>
<model id="Opportunity" query="false" createrowifnonefound="false" datasource="salesforce" sobject="Opportunity">
    <fields>
        <field id="RecordTypeId"/>
        <field id="Name"/>
    </fields>
    <conditions/>
    <actions/>
</model>
</models>
    <components>
        <pagetitle model="Task" uniqueid="sk-2Ltu-247">
            <maintitle>
                <template>{{Subject}}</template>
            </maintitle>
            <subtitle>
                <template>{{Model.label}}</template>
            </subtitle>
            <actions>
                <action type="multi" label="Create Task" uniqueid="sk-2Ltu-252">
                    <actions>
                        <action type="action-sequence" action-sequence-id="e1a259bb-a454-44b8-9420-4c34be1a1cc8">
                            <inputs>
                                <input name="Task Model" value="Task"/>
                            </inputs>
                        </action>
                    </actions>
                </action>
            <action type="multi" label="Create Opportunity" uniqueid="sk-2MCJ-1618">
<actions>
    <action type="action-sequence" action-sequence-id="72eab9c8-6341-4b5a-8f04-f54d2bf6139e" input-Field1="Name">
        <inputs>
            <input name="Model1" value="Opportunity"/>
            <input name="Field1" value="Name"/>
        </inputs>
    </action>
</actions>
</action>
<action type="multi" label="Create Account" uniqueid="sk-2MCJ-1622">
    <actions>
        <action type="action-sequence" model="Task" appendorprepend="prepend" defaultmodefornewitems="edit" affectedrows="context" action-sequence-id="72eab9c8-6341-4b5a-8f04-f54d2bf6139e" input-Field1="Name">
            <inputs>
                <input name="Model1" value="Account"/>
                <input name="Field1" value="Name"/>
            </inputs>
        </action>
    </actions>
</action>
</actions>
        </pagetitle>
        <basicfieldeditor showheader="true" showsavecancel="true" showerrorsinline="true" model="Task" uniqueid="sk-2Ltu-337" mode="edit">
            <columns>
                <column width="100%">
                    <sections>
                        <section title="Section A" collapsible="no">
                            <fields>
                                <field uniqueid="sk-2Ltu-352" id="CallDurationInSeconds"/>
                                <field uniqueid="sk-2Ltu-353" id="Description"/>
                            </fields>
                        </section>
                    </sections>
                </column>
            </columns>
        </basicfieldeditor>
<basicfieldeditor showheader="true" showsavecancel="true" showerrorsinline="true" model="Opportunity" uniqueid="sk-2MCJ-2470" mode="edit">
    <columns>
        <column width="100%">
            <sections>
                <section title="Section A">
                    <fields>
                        <field id="Name" uniqueid="sk-2MCJ-2481">
                            <label>Opportunity name</label>
                        </field>
                    </fields>
                </section>
            </sections>
        </column>
    </columns>
</basicfieldeditor>
    <basicfieldeditor showheader="true" showsavecancel="true" showerrorsinline="true" model="Account" uniqueid="sk-2MCJ-2401" mode="edit">
<columns>
    <column width="100%">
        <sections>
            <section title="Section A">
                <fields>
                    <field id="Name" uniqueid="sk-2MCJ-2412"/>
                </fields>
            </section>
        </sections>
    </column>
</columns>
</basicfieldeditor>
</components>
    <resources>
        <labels/>
        <javascript/>
        <css/>
        <actionsequences uniqueid="sk-2Ltu-303">
            <actionsequence id="e1a259bb-a454-44b8-9420-4c34be1a1cc8" label="Create New Row in Task model" type="reusable" uniqueid="sk-2MCJ-2019">
                <actions>
                    <action type="createRow" model="Task" appendorprepend="prepend" defaultmodefornewitems="edit" affectedrows="context">
                        <defaults>
                            <default type="fieldvalue" field="CallDurationInSeconds" fieldtargetobjects="Task" enclosevalueinquotes="false" value="60"/>
                            
                        </defaults>
                    </action>
                </actions>
                <description>This action sequence creates a new row in the model "Task"</description>
                <inputs>
                    
                </inputs>
            </actionsequence>
        <actionsequence id="72eab9c8-6341-4b5a-8f04-f54d2bf6139e" label="Create new row in any model" type="reusable" uniqueid="sk-2MCJ-2021">
<description>This action sequence creates a new row in an input model. Choose the respective model and field in the button action.</description>
<actions>
    <action type="createRow" model="{{$Input.Model1}}" appendorprepend="prepend" defaultmodefornewitems="edit" affectedrows="context">
        <defaults>
            <default type="fieldvalue" field="{{$Input.Field1}}" enclosevalueinquotes="true" value="default value of your choice"/>
        </defaults>
    </action>
</actions>
<inputs>
    <input type="model" name="Model1"/>
    <input type="model-field" name="Field1" model-source="Model1"/>
</inputs>
</actionsequence>
</actionsequences>
    </resources>
    <styles>
        <styleitem type="background" bgtype="none"/>
    </styles>
</skuidpage>
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
Ugh .... I guess we're not communicating properly. This is a bug where if you select an input model to create a new row in an action sequence, the option to select a field for a defult value is not possible.

Of course I can perform a work around.

So please reproduce for engineers to address. ;)
Hello Pat
Luzie just got me involved in this potential issue. It indeed seems like there is a bit of misunderstanding. But as far as we can tell, the behaviour of Inputmodels seem to work as intended.

I've made you an example based on the Page Luzie built to reproduce the issue:

Inputmodels in action sequences are just placeholder JS objects with no connection to an actual model until you call the action sequence. This is intentional, since Inputmodels are intended as placeholders.




So when you select an Inputmodel rather than a regular model for your Action, you can only select the fields you defined within your placeholder model. (Since you defined no Fields for your Input timeoffmodel, no selectable fields show for rowcreation)


If you choose to use Inputmodels, upon calling of the action sequence you have the ability to choose what your placeholder Model & Its field represent.



Please let me know if this explanation fits your problem or if you need a more in depth description

Regards
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
I understand the explanation. I don't the reasoning though. 

As a user, I wouldn't be privy to this construct of "placeholders" when clicking on the select field button. To alleviate this I suggest displaying a message that only input fields can be selected when selecting a input model.
Photo of Luzie Baumgart

Luzie Baumgart, Official Rep

  • 1,310 Points 1k badge 2x thumb
Thank you for your feedback! I suggested it to the responsible team :-)