Automate

 View Only
Expand all | Collapse all

Evolve drop down

  • 1.  Evolve drop down

    Posted 03-28-2023 06:04

    Hello

    in my evolve form, I have 1 field "basic unit" (drop down from data connection). User can choose a value as basic unit.

    And I have a repeating table incl. the field "altervative unit" (drop down from dataconnection).

    I have a third field "price unit".

    When the user have to insert a price for the item he has to choose the unit for the price.

    This price unit could be either the basic unit or the alternative unit. Both units should be shown as combination in a drop-down list in the field "price unit". 

    I could define that the price unit is a drop-down list from the repeating table "alternative unit". That works.

    BUT the drop down list should also include the value from the basic unit.

    Has anyone an idea?

    Best regards
    Jana



    ------------------------------
    Jana Kuschmierz
    Rigips AG
    ------------------------------


  • 2.  RE: Evolve drop down

    Posted 04-03-2023 03:30

    Anyone an Idea?



    ------------------------------
    Jana Kuschmierz
    Rigips AG
    ------------------------------



  • 3.  RE: Evolve drop down

    Posted 04-04-2023 08:51

    It's a little hard to follow the example, but if I'm understanding it correctly it sounds like you want to concatenate the basic and alternate values into a hidden repeating table and then feed that table into the price drop down. You would need to ensure a rule reloads the price drop down if table values are updated and you will probably need to use build a custom JavaScript rule to build out that table.

    The other option we use a lot is to build a SQL view off of the original data sources that does the concatenation and then that is used as a separate data connection. This is easier to support and requires no special rules on the form.



    ------------------------------
    Joshua Whitener
    Exxon Mobil Corporation
    TX
    ------------------------------



  • 4.  RE: Evolve drop down

    Employee
    Posted 04-04-2023 19:17
    Edited by Sigrid Kok 04-04-2023 19:18

    Hi Jana
    If I understand you, you can use a copy table rule and APPEND the value.  Here's my simple test


    My 2 drop downs are Unit 1 and Unit 2
    Two repeating groups right below them.

    I select EA in Unit 1, and the rules copies the value that equals to the table value of EA to Unit 2 - see it at the bottom on the right.
    The rule looks something like this

    It does NOT check if it already exists in the Unit 2 repeating group or not.   I do have show unique values for the dropdown, so that may take care of it. 

    I think if you want to get fancier, you'd have to revert to JavaScript or potentially use SQL, as @joshua suggested.

    Am not allowed to attach my simple test solution - file type not supported - but I hope you get the idea.

    HTH
    Sigrid



    ------------------------------
    Sigrid Kok
    Precisely Software Inc.
    ------------------------------



  • 5.  RE: Evolve drop down

    Posted 04-06-2023 11:02

    Hello,
    I think you do not understand me right or perhaps I understand you not :-)

    I want just concatenate the value choosen in drop down list 1 with the values of drop-down list 2.

    1. Field = basic unit (Basismengeneinheit BME) --> Drop-down list with p.ex. 3 values (KG,KRT,M) and user choose "KRT" as basic unit.

    2. Field = alternative unit (Alternativmengeneinheit). User fills a repeating table and choose as alternative unit p.ex. "ST" and "M"

    I have a third field "price unit = Mengeneinheit". I would like to have a drop-down list with the concatenated values of Basic unit and alternativ unit, means in this drop-down should only as values possible

    KRT
    ST
    M


     
    But these values are not fix!
    Next time the basic unit is perhaps KG and no alternative unit --> so price unit could be only KG.

    Thanks for helping again.
    Jana



    ------------------------------
    Jana Kuschmierz
    Rigips AG
    ------------------------------



  • 6.  RE: Evolve drop down

    Employee
    Posted 04-06-2023 11:40
    Edited by Sigrid Kok 04-06-2023 12:26

    Hi Jana

    Yes, this example is doing just that, i.e. copying the value selected for Unit1 to the potential values of Unit2 - both dropdowns populated by two repeating groups, and those repeating groups are populated from data connection.

    One thing to keep in mind is that repeating groups can be viewed as tables in Composer (aka solution builder).  

    In my example:
    (1) Unit1 is a dropdown field is sourced from a repeating group called Unit1_dd 
    (2) Unit2 is a dropdown field is sourced from a different repeating group called Unit2_dd

    Both repeating groups are populated by a data connection using a QUERY control.
    You can use a QUERY control to populate the repeating group from it, like:
    this is populating my repeating group. 

    And the dropdown source is the repeating group.


    When you pick a value for Unit1 field, it kicks off a COPY TABLE rule from repeating group (table) Unit1_dd to Unit2_dd.  If you want to use some type of concatenation of values, then have a helper field set to concatenate values from two fields and use that value to set the 3rd field - adapt it to meet your needs.
    It copies the selected value from the Unit1 repeating group (aka table) and copies that value to the repeating group (aka table)  for Unit2 using a copytable rule.
    It does that through the condition in the rule - where the selected value in Unit1_dd value is = to selected value of the dropdown field Unit1.

    In summary,
    both Unit dropdowns are sourced from repeating groups, i.e. the data source is a repeating group(aka table)
    those repeating groups are populated by data connections
    The COPY TABLE rule is the way to copy the value from the first one to the second one. 
    Once the rule has run, the potential values for the dropdown Unit2 includes the value selected for the dropdown field Unit1

    Note that this approach also doesn't permanently add Unit1 value to the list for Unit2.  If that's what you want, then you'll want to insert the selected value of Unit1into the data source of Unit 2

    It's the most straightforward way I could get this to work without doing something custom (like JavaScript).  If it doesn't work for you, please disregard.  Someone else may have a better idea for your scenario.

    Best regards,
    Sigrid




    ------------------------------
    Sigrid Kok
    Precisely Software Inc.
    ------------------------------



  • 7.  RE: Evolve drop down

    Posted 04-11-2023 05:27

    Hello Sigrid
    thanks for your help. I have tried to tested it.

    But the value of my field "Unit 1" does NOT comes from a repeating table but just from a drop-down list (dataconnection). So my primary source is not a repeating table. 
    So not both Unit drop-down are from a repeating table just one of them.

    And the value of the field "Unit 1" should also not be add to values in the repeating table of unit 2. The user should not have the chance to choose the value of unit 1 in the repating table.

    The value of the field "unit 1" should add to the values of the field "unit 2"

    I think perhaps in this way I cannot use the copy table data because the sources are not both a repeating table.

    Did you understand me?



    ------------------------------
    Jana Kuschmierz
    Rigips AG
    ------------------------------



  • 8.  RE: Evolve drop down

    Employee
    Posted 04-11-2023 10:01

    Yes, Jana, I understand you. 
    You can copy them to a repeating table - that is what I tried to explain.  Hopefully you understand that now.
    Like I said, if you don't care for this approach, feel free to disregard.
    Best Regards,
    Sigrid



    ------------------------------
    Sigrid Kok
    Precisely Software Inc.
    ------------------------------



  • 9.  RE: Evolve drop down

    Employee
    Posted 04-19-2023 05:59

    Hello,
    Here is another way how you can do this.  (I am setting the values in a dropdown field named "Combined" on the form)
    * simply configure dropdown to repeating table content  as shown in below screenshot.

    * now select the "base unit" drop down and apply rules : 
     1. reload dropdown value for dropdown : combined.
     2. set value for dropdown: combined -> set the same value as selected in "base unit" 
    (refer below screenshot)

    * Also set force update property of "Combined" Dropdown to false.

    * Deploy the Solution and test.

    Hope this help.

    Regards
    Hammad Naeem
    SE II - Precisely Software Inc




    ------------------------------
    Hammad Naeem
    Precisely Software Inc.
    ------------------------------



  • 10.  RE: Evolve drop down

    Posted 04-21-2023 10:53

    Hello Hammad

    many thanks for your help. I tried to test your proposal. Everything works fine. But whe I add a value to the repeating table AFTER choosen the value in the combined drop-down the basic unit disappear from the price unit drop down.

    When I change the field basic unit then to another value and back then it appears. 
    Same behavior when I set a add the condition "if basic unit is not blank" to the rule on the basic unit.

    Do you have also an idea for this?

    Many thanks in advance.
    jana



    ------------------------------
    Jana Kuschmierz
    Rigips AG
    ------------------------------



  • 11.  RE: Evolve drop down

    Employee
    Posted 04-21-2023 13:40

    Hi Jana,
    I tried the scenario, but it works for me no matter what combination of steps I perform.
    can you please elaborate may be add some screenshots of what value is disappearing after which step.

    Regards
    Hammad Naeem



    ------------------------------
    Hammad Naeem
    Precisely Software Inc.
    ------------------------------



  • 12.  RE: Evolve drop down

    Employee
    Posted 04-26-2023 05:29

    Hi jana,
    Try adding Reload Dropdown option rule on alternative unit dropdown as shown below.

    This will reload values for Price unit as you add new values to the repeating table.
    Hope this helps.

    Regards



    ------------------------------
    Hammad Naeem
    Precisely Software Inc.
    ------------------------------



  • 13.  RE: Evolve drop down

    Posted 04-26-2023 11:48

    Hello,
    yes the rule from alternativ unit was false - I changed into "reload drop down price unit".
    But when you do the following steps it's not working fine.
    1. insert "ST" as basic unit --> it shows "ST" as price unit
    2. insert "KG" as alternative unit --> it shows both as price unit "ST" and "KG"
    3. change price unit to "KG"
    4. add a new alternative value "TO"
    5. open price unit --> just "KG" and "TO" is in drop-down list. The "ST" from basic unit disappear



    ------------------------------
    Jana Kuschmierz
    Rigips AG
    ------------------------------



  • 14.  RE: Evolve drop down

    Employee
    Posted 04-26-2023 15:56

    Hi Jana,
    Please change the rules on alternative unit dropdown as shown in screenshot below:




    Regards




    ------------------------------
    Hammad Naeem
    Precisely Software Inc.
    ------------------------------



  • 15.  RE: Evolve drop down

    Posted 04-27-2023 05:16

    Hello
    in this way it works fine. But it changed the choosen price unit. And this should be not because I have different departements in my workflow.
    First departement propose basic unit and alternativ unit and make a also proposal for the price unit perhaps not basisc unit. 2. departement (purchasing) can add alternativ unit and 3. departement sales define the price and the price unit. So if 2. departement add a line in the repeating table alternativ unit, they change the proposal from the 1. department.



    ------------------------------
    Jana Kuschmierz
    Rigips AG
    ------------------------------



  • 16.  RE: Evolve drop down

    Employee
    Posted 04-27-2023 10:09

    Hi Jana,
    As there are lots of ifs and buts for the use-case this is difficult to achieve using action rules.
    try below custom javascript rule on you alternativeUnit dropdown.
    --------------------------------------------

    var oldValue = $form.getValue('/my:myFields/my:Price_unit')
    $form.setValue('/my:myFields/my:Price_unit','');
    $form.reloadDropDownOptions('/my:myFields/my:Price_unit',true);
    $form.setValue('/my:myFields/my:Price_unit',$form.getValue('/my:myFields/my:Basic_Unit'));
    $form.setValue('/my:myFields/my:Price_unit',oldValue);
    -------------------------------------------------
    Hope this helps.

    Regards


    ------------------------------
    Hammad Naeem
    Precisely Software Inc.
    ------------------------------



  • 17.  RE: Evolve drop down

    Posted 04-27-2023 12:20

    Hello Hammad
    thanks you so much. This works really fine.
    Many thanks for your help.

    Jana



    ------------------------------
    Jana Kuschmierz
    Rigips AG
    ------------------------------



  • 18.  RE: Evolve drop down

    Posted 05-05-2023 06:05

    Hello Hammad

    I saw now, when I delete a row in alternativ unit, it does not delete this unit from the price unit dropdown. Is ist possible to add this in the java script rule? Thanks in advance.
    Jana



    ------------------------------
    Jana Kuschmierz
    Rigips AG
    ------------------------------



  • 19.  RE: Evolve drop down

    Employee
    Posted 05-05-2023 07:29

    Hi Jana,
    No it is not possible to reload it on row deletion.
    You can apply custom rule from alternate unit dropdown to another button on the form.it will remove the extra values.
    So, if you have an approve/save custom buttons on the form you can apply the rule on this button or you can add a new button to reload the dropdown values.

    Regards




    ------------------------------
    Hammad Naeem
    Precisely Software Inc.
    ------------------------------



  • 20.  RE: Evolve drop down

    Posted 05-05-2023 10:39

    Hello
    I tried to set a validation rule on the price unit.
    If price unit is not equal to basic unit and not equal to alternativ unit than error. 


    But wen I choose basic unit and price unit is the unit from the second row of alternativ unit, than comes error. When I choose ST there is no error. It looks like he only check the first row of the repeating table. 




     
    2. 



    ------------------------------
    Jana Kuschmierz
    Rigips AG
    ------------------------------



  • 21.  RE: Evolve drop down

    Employee
    Posted 05-05-2023 11:15

    Hi jana,
    It is not possible to check if that value is present in repeating table or not using action rules.
    try below mentioned javascript code:
    ------------------

    var rows = count('/my:myFields/my:Repeating_Table_2/my:Repeating_Content/my:Alternativ_Unit');
    var validvalue = false;
    for(var i=0;i<rows;i++)
    {
     
    if ($form.getValue('/my:myFields/my:Price_unit') == $form.getValue('/my:myFields/my:Repeating_Table_2/my:Repeating_Content['+i+']/my:Alternativ_Unit')) { 
        validvalue = true;
        break;
        }
     
    }
     
    if ($form.getValue('/my:myFields/my:Price_unit') != $form.getValue('/my:myFields/my:Basic_Unit') && !validvalue) { 
    $form.displayError('/my:myFields/my:Price_unit','\'Invalid value\'');
    }
    else
    {
        $form.removeError('/my:myFields/my:Price_unit')
    }
    ------------

    Hope this helps.

    Regards


    ------------------------------
    Hammad Naeem
    Precisely Software Inc.
    ------------------------------



  • 22.  RE: Evolve drop down

    Posted 05-11-2023 09:22

    Hello Hammad

    i tried your rule, many thanks, just one thing now when I choose the basic unit there is an error on the field price unit. It only check the alternative unit. With alternative unit everything works fine, but not with basic unit.


    Could you add the basic unit to the rule, that there is no error, when price unit = basic unit? Thank you in advance.

    Jana



    ------------------------------
    Jana Kuschmierz
    Rigips AG
    ------------------------------



  • 23.  RE: Evolve drop down

    Employee
    Posted 05-12-2023 11:28

    Hi Jana,
    It should not happen for price unit field.
    force option value property should be set to false. see screenshot :

    I receive error only if it is set to true.

    Regards



    ------------------------------
    Hammad Naeem
    Precisely Software Inc.
    ------------------------------



  • 24.  RE: Evolve drop down

    Posted 05-15-2023 03:01

    Thanks Hammad, now it works perfectly. 



    ------------------------------
    Jana Kuschmierz
    Rigips AG
    ------------------------------