Help with dynamic action and the selection list item

G ' Day Apex gurus.

I have problems trying to achieve to trigger the Help window from an element automatically select. A Help window is triggered when it is clicked on the label of an item, but my customer wants to be triguered automatically as soon as the user clicks to view the options in the select list.

I think I should be able to do with dynamic actions but I can't function.

I know when someone clicks on the label of the item selection list trigger this JavaScript

JavaScript:popupFieldHelp('277938589795252851','1545903379570909')

So I want to trigger the javascript also when the user click on the item selection list and pull down the options and for that I think that the dynamic action is the way to go, but I can't do things.

That's what I have to do:

I created a dynamic option as follows:

Name: test
Sequence: 30
Even: click
Selection type: product (s)
Article (s): P1_RATING <-a selection list item
Condtion: - no requirement.

Real Actions
Sequence: 10
Action: Run the JavaScript Code
Fires when the result of the event is: true
Fire on loading the page: checked
Code: javascript:popupFieldHelp('277938589795252851','1545903379570909')

Thank you anyone who can tell me what I'm doing wrong here or bring a solution to my problem to trigger the Help window from an element automatically select.

Kind regards
Carlos

Hi Carlos,

I've set up a test case of exactly in the same way and it worked fine for me. I've created a page element called P1_DA_DEMO and added some values of the static selection list, then added a help text. I used the settings are lower, I suggest you try again, but also make sure that you have no other Javascript errors on the page. Use a tool like firebug to check.

Name: Action Dynamics demo
Sequence: 10
Even: click
Selection type: product (s)
Product (s): P1_DA_DEMO<- a="" selection="" list="">
Condtion: - no requirement.

Real Actions
Sequence: 10
Action: Run the JavaScript Code
Fires when the result of the event is: true
Fire on loading the page: unchecked
Code: javascript:popupFieldHelp('277938589795252851','1545903379570909')

Scope of the event set a Bind s.

Thank you

Paul

Tags: Database

Similar Questions

  • Need help with dynamic Action through 4 items

    Hello everyone.

    I'm having some trouble trying to comp with dynamic action that will turn on or display a select list item when a value is set for the four elements of the Radio button group.

    P1_SELCT_LIST

    P1_RADIO_GROUP_1

    P1_RADIO_GROUP_2

    P1_RADIO_GROUP_3

    P1_RADIO_GROUP_4

    So once all four Radio groups are not null, I want the select View list item.

    Any help with this would be great.

    I'm on Apex 4.2.0.00.27

    Hello

    You can create the following action:

    Event: click on

    Selection type: jQuery selector

    jQuery selector: radio

    condition:

    $v ('P1_RADIO_GROUP_1')! == ''

    &&

    $v ('P1_RADIO_GROUP_2')! == ''

    &&

    $v ('P1_RADIO_GROUP_3')! == ''

    &&

    $v ('P1_RADIO_GROUP_4')! == ''

    Then add a real Action as follows:

    ACtion: show

    Fires when the result of the event is: true

    Fire on the page loading: No. (uncheck)

    Assigned to elements, selection type: product (s)

    Product (s): P1_SELECT

    Also add an Action to false as follows:

    ACtion: hide

    Fires when the result of the event is: false

    Fire on the page loading: YES (check)

    Assigned to elements, selection type: product (s)

    Product (s): P1_SELECT

    Kind regards

    Vincent

    http://vincentdeelen.blogspot.com

  • Refresh the report based on the select list item

    Hello world

    Someone has the answer to refresh a report based on an element that I select in a select list? I currently have the item in the list of selection and a report under him I wrote a sql that fills with data. If I choose an article in my select list, I want to change the data in my report. What I have to write separate sqls for each item to be fired or write some type of process. Can someone help me?

    Thank you
    Ryan

    Write directly in the SQL report. Your select list item will be the variable in the SQL.

  • Help with dynamic Action with pl/sql and Javascript

    Hi all
    I'm a little hard with the following and I was wondering if someone can help me.
    My test app is here:
    http://apex.oracle.com/pls/apex/f?p=32581
    
    workspace: Leppard
    Login: guest
    pw: app_1000
    
    Tab: DB Link (page 19)
    I have a list of unique selection on the page that queries a table in my diagram.

    This is the flow that works, but not the user experience I want:
    User clicks on the button Create Page 19 > the next page, page 20, appears as a popup window > user enters the name of the link = "MyLink" (or other) and one unit number, i.e. 1234 (or other) > user clicks 'Create using process' button > success message > user closed the window to return to the page 19 > user clicks LOV refresh to refresh the list of selection so that the new value is displayed.

    That's what I'm aiming for: user clicks on the button Create Page 19 > the next page, page 20, appears as a popup window > user enters the name of the link = "MyLink" (or other) and one unit number, i.e. 1234 (or other) > user clicks button "create using the DA ' > dynamic action is called running pl/sql closes the popup window and refreshes the list of selection on page 19.

    I know that I have some problems with my dynamic action. First of all, the pl/sql is not yet recognize the values that I enter the fields in item on page 20. I created a first pl/sql "null;" to force these items in session state, but it does not work for me and the pl/sql just inserts a null value into my table. Secondly, I can't get javascript to fire code to refresh the list of selection on page 19. The code I use in the DA is the same thing as what is behind the button refresh LOV, so I am confident that the code works, I just can't get this fire click the button "create using the DA" on page 20.

    Sorry if this is confusing - I can clarify if necessary, let me know. Thanks in advance. Of course I'm still learning...

    John

    Published by: John K. on May 30, 2013 19:28

    I modified your DA as follows.

    In real Action of DA,.

    1 Seq 10, I added the element page 20 Page points to submit and return Pagenames. You forgot to add items here
    2 Seq 20, I changed your simple code to insert. Simple code just insert
    3 Seq 30, I added the new code to close the window and reload the window open.

    Thank you
    Lacombe

  • activation / deactivation of field with dynamic action and apply the attribute 'required value.

    Hello

    Wanted to know how to force the 'required' attribute for the element off after that is "activated" by a dynamic action.

    For example, consider employee form.  I would like to disable the column of employment and salary.  As soon as the user enters the name of the employee, I will 'activate' JOB and SAL columns using "dynamic action".

    IMG-1.png

    IMG-2.png

    And above works fine.  Please note that both JOBS & SAL of columns 'NULL' according to the DB table.  My question is, how to comply with the condition of 'value' Yes, after allowing them.

    Another example would be, when the user selects 'Check' or 'Project', the 'no project' column will be activated.  Otherwise, "Project No." column is disabled (that is, the value is not required).  However, when turned on, I want to apply "value required" in this column.   How to get there?   (I use APEX 4.2.6)

    Thank you

    -Anand

    Why you do not create a function that returns a Boolean, validation of the page?

    You can do something like

    BEGIN

    IF: P5_ENAME IS NOT NULL THEN

    IF: P5_JOB IS NULL THEN

    Returns false;

    ON THE OTHER

    Returns true;

    END IF;

    END IF;

    END;

    You can change it to any desired column.

  • Dynamic action in two selection list

    Hi all

    I created two select lists.one is parent of other child.

    I can get the child list correctly from the article values parent lov cascading

    For example: the company name of parent element values: x, y, z, etc.

    x with 3 customers say a, b, c

    There is no customer for y

    z with 2 customers say e

    now, I want to hide the element of the child when the parent having no child.

    Now when I select 'y' for the example above, I would like to hide the child element.

    How can I do?

    Hello

    You can do the following:
    1. create a hidden page element, say PX_HIDE_SHOW_FLG
    2. create a dynamic Action of type 'Set value' on the element parent to update PX_HIDE_SHOW_FLG. You can choose the "value Type" as "body of the PL/SQL function. The code in the function must return "Y" or "n" based on logic (count the number of children under the selected parent). You can trigger this DA on 'change' of the parent element.
    3. now, create another DA on PX_HIDE_SHOW_FLG to hide and show the child LOV article based on its value. For example, if value (of the page hidden item) = 'Y', and then hide, another show.

    Thank you
    Rohit

  • dynamic action on the selected value shuttle

    Hello

    Can anyone help me in this.

    I guess a requirement

    There is a shuttle Apex and multiple selection is allowed

    and there are values such as:-others, first, second

    but when we choose other no other value should be able to select

    in what other is selected in the shuttle a textbox is displayed by dynamic action

    example on https://apex.oracle.com/pls/apex/f?p=76604:3:4326822625865:

    workspace:-REEMATEST

    username:-test

    password:-test

    76604 application

    page 3

    ReemaPuri wrote:

    can you give me a link for the dynamic creation of checkbox

    FOR EXAMPLE BASED ON CREATED LOV SHARE COMPONENT

    Select the column name as the name of column d, r

    the name of the table

    Boxes are just another way to make a LOV. For a dynamic set of checkboxes, the standard pair of value/label LOV SQL projection is required in the definition:

    select initcap(dname) l, to_char(deptno, 'tm9') v from dept
    order by v asc
    

    If additional values are required, they can be included in the query using unions:

    select initcap(dname) l, to_char(deptno, 'tm9') v from dept
    union all
    select 'Other', 'OTHER' from dual
    order by 2 asc
    

    Checkbox events can be handled by dynamic actions as indicated on page 586 of your test App. Note that I prefer to enable and disable the controls on form rather than hiding and showing them that there is less confusion for the user. It is simple to change the disable/Enable dynamic actions to hide and show if necessary.

  • Check generate some Comp based on the drop-down list box and the selection list?

    I currently have a dropdown list with the three sizing options in it. Then I have two check boxes, one is ticked ideally would create the model to its normal size composition and if other is checked that it would reverse the widthxheight in the size of the composition. Then below that I have a "Generate" button, I want to be able to click and according to my selections, it creates the model.

    Looks like I need a kind of if then statement, but I'm having a hard time putting the two together. See below what I have so far.

    There may be missing parts, but I have it all working in a decibel pallate currently. I don't have functionality related to a button again.

    Any help would be appreciated!

    (also I don't know how to format the script spread here so apologies for that)

    ---------------------------

    palette controls

    templateGen.VerticalCheckbox = new Object();

    templateGen.HorizontalCheckbox = new Object();

    set the values for controls

    templateGen.comLookup = new Object();

    templateGen.compLookup = 'Template1 ';

    templateGen.compLookup = "Template2";

    templateGen.compLookup = "Template3."

    function templateGen_getHashValues (hash)

    { // {{{

    var ary = new Array();

    for (k hash) {}

    ARY.push (Hash [k]);

    }

    return area;

    } // }}}

    menu "composition".

    var panelGrp1 = templateGen.palette.add ('Panel', undefined, 'Templates Comp');

    compGrp1 = panelGrp1.add ('group', undefined, 'List templates');

    compGrp2 = panelGrp1.add ('group', undefined, 'Orientation');

    compGrp3 = panelGrp1.add ('group', undefined, 'Generate');

    templateGen.compList = compGrp1.add ('dropdownlist', LIST_DIMENSIONS, templateGen_getHashValues (bapple.compLookup));

    templateGen.compList.helpTip = "choose the type of desired here device model. All compositions are 60 fps. « ;

    templateGen.compList.selection = 'Template1 ';

    templateGen.compList.graphics.foregroundColor = darkColorBrush;

    templateGen.VerticalCheckbox = compGrp2.add ('checkbox', undefined, 'Portrait');

    templateGen.VerticalCheckbox .value = true;

    templateGen.HorizontalCheckbox = compGrp2.add ('checkbox', undefined, 'Horizontal');

    templateGen.HorizontalCheckbox .value = false;

    templateGen.generateBtn1 = compGrp3.add ('button', undefined, 'Generate');

    applyBtn.onClick =? ;

    When I work with drop-down menus, I always liked to tie the data they represent (like the width and height of the model in this case) directly to the elements.

    I run the code to really check, but it should work like this:

    -----------------

    Add models to your drop-down list and store the items in a table

    models var = [];

    models [0] = templateGen.compList.add('item','template1');

    models [1] = templateGen.compList.add('item','template2');

    models [2] = templateGen.compList.add('item','template3');

    set a width and height of each element

    models [0] .width = 1280;

    models [0] .height = 720;

    models [1] .width = 1024;

    models [1] .height = 768;

    models [2] .width = 1920;

    models [2] .height = 1080;

    Choose the item that should be selected by default

    models [0] .selected = true;

    applyBtn.onClick = function() {}

    read the width and height of the selected item

    var width = templateGen.compList.selection.width;

    var height = templateGen.compList.selection.height;

    {if (templateGen.VerticalCheckbox.value)}

    swap width and height

    var temp = width;

    width = height;

    height = temp;

    }

    now create your comp here with the given width and height

    }

  • Dynamic action on the amendment of item with AjaxRequest value does not

    Hello
    I have a select list of users called P222_USERS. When a new user is selected, I want to run a query to find the email to the selected user and paste it into the P222_EMAIL text field.

    I have a process on demand on the change of P222_USERS that calls a javascript function:
    fetchEmail ($('#P222_USERS').val ());

    In my head, the function calls an application process in an Ajax request:

    function fetchEmail (email) {}
    var ajaxRequest = new htmldb_Get (null, & APP_ID, 'APPLICATION_PROCESS = GET_EMAIL', 0);
    ajaxRequest.add ("P222_USERS", $('#P222_USERS').val ());
    ajaxResult = ajaxRequest.get ();
    }

    Here is my request PLSQL process GET_EMAIL:
    Start
    Select send to: P222_EMAIL of connection where userid =: P222_USERS;
    end;

    Enamel is not filled is at: P222_EMAIL. I know I'm close, but have already spent a lot of time with various alternates to the above function / on the application process. Any help is greatly appreciated. I wish the process of PL/SQL on the item change worked that way instead of through AJAX.

    Thank you
    Johnny

    Johnny98 wrote:
    Hello
    I have a select list of users called P222_USERS. When a new user is selected, I want to run a query to find the email to the selected user and paste it into the P222_EMAIL text field.

    I have a process on demand on the change of P222_USERS that calls a javascript function:
    fetchEmail ($('#P222_USERS').val ());

    In my head, the function calls an application process in an Ajax request:

    function fetchEmail (email) {}
    var ajaxRequest = new htmldb_Get (null, & APP_ID, 'APPLICATION_PROCESS = GET_EMAIL', 0);
    ajaxRequest.add ("P222_USERS", $('#P222_USERS').val ());
    ajaxResult = ajaxRequest.get ();
    }

    Here is my request PLSQL process GET_EMAIL:
    Start
    Select send to: P222_EMAIL of connection where userid =: P222_USERS;
    end;

    Enamel is not filled is at: P222_EMAIL. I know I'm close, but have already spent a lot of time with various alternates to the above function / on the application process. Any help is greatly appreciated. I wish the process of PL/SQL on the item change worked that way instead of through AJAX.

    Thank you
    Johnny

    The fact is that your application process defines the elements of value in session state and do not meet the side value client/browser

    If you need to return the value of the application process and to assign the value in javascript like this

    function fetchEmail(email){
    var ajaxRequest = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=GET_EMAIL', 0);
    ajaxRequest.add('P222_USERS', $('#P222_USERS').val());
    ajaxResult = ajaxRequest.get();
    //newly added
    alert(ajaxResult);
    $s('P222_EMAIL',ajaxResult);
    }
    
    //amend your On Demand PLSQL Process GET_EMAIL like this
    begin
    select email into :P222_EMAIL from login where userid = :P222_USERS;
    //newly added
     htp.prn(:P222_EMAIL);
    end;
    

    In this way the value will be set in and client side state both session

  • Variable setting wrong with dynamic action for the region of report

    Hello

    I can't setting a variable. Here are the details of connection:

    Connection information:

    TCARMY workspace

    User Apex_dev

    Password dev_apex

    Application 88542

    Page 11

    If you run the page 11 and just click on submit, there will be two rows. If you click on one, the modal region won't say no data found. If you click on the button submit once again, the value is passed if you click on it now, the results arrive. If you click on the second row, it still shows the value of the first row. If you click on submit again after clicking on the second line, then it is displayed correctly. It seems that the value is set to submit it. I want this to work when clicked, and then for the sql to run with the value that is in this variable when clicks on the element. There is a bit of javascript page level and dynamic action. Something is not right to the installation.

    The modal window should popup and run the sql at that time with the variable data and view the two columns. And if the user clicks on the second row, it would display the data in the row.


    Thank you

    Tim

    TC-army wrote:

    If you run the page 11 and just click on submit, there will be two rows. If you click on one, the modal region won't say no data found. If you click on the button submit once again, the value is passed if you click on it now, the results arrive. If you click on the second row, it still shows the value of the first row. If you click on submit again after clicking on the second line, then it is displayed correctly. It seems that the value is set to submit it. I want this to work when clicked, and then for the sql to run with the value that is in this variable when clicks on the element. There is a bit of javascript page level and dynamic action. Something is not right to the installation.

    What has not been set up right, it's that the element of P11_NAICNUMD parameter was not specified in the source attribute of Page to go to the region, modal Discount. The current value in the browser page, therefore, was not defined in session state when the report has been updated by the dynamic action. When

  • Please help with conditional actions showing the PlayBar

    I tried to set up a tip action that will not allow users to move forward until they have clicked on the 3 themes I want to see again them.  I assigned variables, follow the tutorials and do everything now.  Please help how I my Advanced actions set upwards... everything shows and hides all work so I have to assume that the assignment of variable works as well.  I used numbers initially and changed my value of the variable of "dude" just to make sure I was not missing something.

    Capture.PNGCapture2.PNGcapture3.PNG

    Here's the aciton condtional which is performed after the entry of the slide

    Capture4.PNG

    All logic seems in tact for me however I click on each of my boxes and all conditions must be true, but will not display game bar...

    Note: I also tried to show a next button and just show the things randomly with the same logic and it just will not work... What am I doing wrong?

    Something escapes me in your question: How do trigger you the conditional action? I suspect that he is never executed, but may be wrong of course.

    I created a small example to check: slide contains 3 buttons that trigger an action condtional with two decisions. The first decision is a simulated standard measure (condition 1 = 1 is always correct) assigns the value 1 to the variable corresponding user and displays a caption text, that was initially hidden. This is a screenshot of this first decision Stand for the first Bt_One action to be triggered by the first button:

    The second decision Check is the action of condtional real, very similar to yours. This will be done after the first decision:

    Create a duplicate of this action for the other two buttons, you only have to edit the first decision where the user variable needs to be changed.

    In my example, when you click the last button (regardless of the sequence) all the text captions should have been disclosed (I na not hide others, but you can do the same of course) and the second decision check will result in a positive response, so the playback bar appears immediately.

    Lilybiri

  • Help with Essbase 9 and the Java API

    Hi, I am trying to connect to Essbase to a Java desktop app and I'm unable to do so. I need to know if I'm in principle do the right things and if I have the good environment set up.

    We have a server with Essbase version 9.3.1. We normally use essbase through the Excel add-in, and I already wrote it Excel applications that can use both the add-in and the Essbase API in VB. Now, I need to connect to Essbase but out of Excel and using the Java API. I have no idea what is APS don't my Essbase administrator.

    My request has the following (adapted from a post on this forum)-
    Public Shared Sub main (String [] args) {}
    String s_userName = 'user ';
    String s_password = "password";
    String s_olapSvrName = "ustca111";
    String s_provider = "http://localhost:13080/aps/JAPI ';
    try {}
    ESS IEssbase = IEssbase.Home.create (IEssbase.JAPI_VERSION);
    DOM IEssDomain = ess.signOn (s_userName s_password, s_provider, null, false);
    IEssOlapServer olapSvr = (s_olapSvrName) dom.getOlapServer;
    olapSvr.connect ();
    System.out.println ("connection to the server Analyic '" + olapSvr.getName () + "' has been a success.");
    olapSvr.disconnect ();
    } catch (EssException exp) {}
    System.out.println (exp.getMessage ());
    } }

    I'm running my app on my computer, not on the Essbase server, and the user name that I use is the same one I use (as a user of Essbase) through the Essbase Addin in Excel, not an admin login.

    When I run the application, I get:
    "Cannot connect to the Server.Make provider ensure that access code settings are correct and the server of the provider is running."

    Please can you confirm:
    (1) do I need an admin login for my client application to connect to the Essbase server or can I use a dial-up connection in normal play, like the one I use in Excel?
    (2) is the same provider regardless of the computer, i.e. "http://localhost:13080/aps/JAPI '; How can I know what this could be? Where can I get this information?
    (3) how can I make sure that the server is running the server needed 'provider', it's just a service that appears on the server services.msc? What should I ask the Essbase administrator for him to tell me what I need?

    Thank you very much.

    Leo

    Leo,

    You have APS and Shared Services running on your server? It would be the first question to answer. If you put in the url (http://localhost:13080/aps/JAPI, in your program) in a browser, you get a generic APS screen, or you get an error "page is not available. Unless you connect to APS that is running on the same computer that is running your Java application, the section 'localhost' should be the name of your APS Server.

    (1) for this Java program, you connect just to read only access that ID is OK
    (2) the supplier would be the same for every customer. The provider is the URL of your APS Server. Unless you run in embedded mode, you must APS to connect with the Essbase server. In embedded mode, you talk with the Essbase server, see [this thread | http://forums.oracle.com/forums/thread.jspa?messageID=3314485?].

    (3) APS - Analytic Provider Services, I'm not sure what it would show on a Windows Server. I suppose it would be something on Hyperion System 9 Analytic Provider Services. If you have installed APS, I would try the embedded road because it's the only way you will get to work.

    Published by: rjgideon on June 2, 2010 16:18

  • Having trouble with a script distort the selection of items that are part of an envelope.

    Hello, first assignment in time I hope I'm doing this correctly.

    Basically I have a file that requires a modification of the text which is then exported and edited in Photoshop. I recently started experimenting with fake envelope because it gave me more control over the duration of my text boxes of documents, but when I run my script on the document, it fails to catch any text that is wrapped with a distortion of the envelope. I guess it's because the script is looking for managers of related texts and partly of a distortion of the envelope text becomes something else.

    Thank you!

    OK, this should do the trick...

    Break and remake it!

    var sel = app.activeDocument.selection;
    app.executeMenuCommand ('Release Envelope');
    var sel2 = app.activeDocument.selection;
    for(var i = 0; i < sel2.length; i++){
      if(sel2[i].typename == "TextFrame"){
          sel2[i].contents = "new text for envelope";
      }
    }
    app.executeMenuCommand ('Make Envelope');
    
  • Dynamic action and the sequence for popluating items

    I try to use the sequence to fill an item after the other (on the loading of the Page).

    So basically I'm pushing data using a SQL to item_A then fill item_B based on the result of item_A.

    I thought that if I use the sequence it will work, but I don't get any value for item_B.

    What is the best way to do it?

    See you soon,.

    Mehr

    Mehr wrote:

    With the help of the Source is perfect however although I can easily use it to fill the item_A, but when I write this in the section item_B Source:

    item_A + 10 (example)

    the result is null.

    Can you advise?

    I guess the item_A and B are supposed to be in a sequence type of situation so that one can be done after the other, but I doubt if there is any order for items in a form (page).

    Page elements are displayed in order of sequence / the box item. Their source and default values are also defined in this order. However, the source attributes / by default defines only the values rendered on the page, not in session state (you can see this by using the Session Viewer when the page is rendered in first). This means that you cannot reference the value of an element any defined using attributes source / default to the course to see the page. To set values in the elements of rendering and session state, set the initial values using calculations or process rather than the source attributes / by default.

  • Help with hard drives and the "switch" statement

    All the

    I was wondering if you could please help? It's probably more to do with "powershell" than powercli but are... What I'm trying to achieve is the ability to create a function that runs through all my VM - counts the number of hard drives by VM - crosses EACH hard drive and gives me the ability of each of them. He then returns to a csv file (which iknow how to do). The segment below is pretty well what I want, but I was wondering if there was a way to reduce the amount of code! I tried using a foreach statement, but got stuck (PS - the maximum number of hard drives of our virtual machines can have is 5)

    I'm just using a switch statement, because that is what I "thought" answered the problem. However if there is a way I could get the same result without so much 'code' that would be ideal.

    Switch ($vm.harddisks.length) {}

    ($vm.harddisks.length - eq. 1) {

    ($obj |) Ajouter-Membre Noteproperty 'Disk 1' ($vm.harddisks [0] .capacitykb))

    }

    ($vm.harddisks.length - eq 2) {

    ($obj |) Ajouter-Membre Noteproperty 'Disk 1' ($vm.harddisks [0] .capacitykb))

    ($obj |) (Add - Member Noteproperty "Hard Disk 2" ($vm.harddisks [1] .capacitykb))

    }

    ($vm.harddisks.length - eq 3) {

    ($obj |) Ajouter-Membre Noteproperty 'Disk 1' ($vm.harddisks [0] .capacitykb))

    ($obj |) (Add - Member Noteproperty "Hard Disk 2" ($vm.harddisks [1] .capacitykb))

    ($obj |) Ajouter-Membre Noteproperty "Hard drive 3" ($vm.harddisks [2] .capacitykb))

    }

    ($vm.harddisks.length - eq 4) {

    ($obj |) Ajouter-Membre Noteproperty 'Disk 1' ($vm.harddisks [0] .capacitykb))

    ($obj |) (Add - Member Noteproperty "Hard Disk 2" ($vm.harddisks [1] .capacitykb))

    ($obj |) Ajouter-Membre Noteproperty "Hard drive 3" ($vm.harddisks [2] .capacitykb))

    ($obj |) (Add - Member Noteproperty 'Hard Disk 4' ($vm.harddisks [3] .capacitykb))

    }

    ($vm.harddisks.length - eq 5) {

    ($obj |) Ajouter-Membre Noteproperty 'Disk 1' ($vm.harddisks [0] .capacitykb))

    ($obj |) (Add - Member Noteproperty "Hard Disk 2" ($vm.harddisks [1] .capacitykb))

    ($obj |) Ajouter-Membre Noteproperty "Hard drive 3" ($vm.harddisks [2] .capacitykb))

    ($obj |) (Add - Member Noteproperty 'Hard Disk 4' ($vm.harddisks [3] .capacitykb))

    ($obj |) (Add - Member Noteproperty 'Hard Disk 5' ($vm.harddisks [4] .capacitykb))

    }

    write-host $obj

    }

    Once again thanks in advance

    Munster99

    Try something like this

    $i = 1
    $vm. Hard drives | %{
    $obj | Noteproperty Add-member ('Hard drive' + $i) ($vm.harddisks [$i - 1] .capacitykb)
    $i ++
    }
    write-host $obj

Maybe you are looking for