How to append values in wizard tool in a list
Application Type
Reactive
Platform Version
11.14.1 (Build 34445)

Hi Team 

I have used the Wizard tool in my project there I have four parts for storing some address details each container is placed under the if conditions of current stage. the current stage is defined by the add button. I want to append the values enter in all four parts into a single list variable. I have 4 input field in part 1 and same wise in remaining 4 part.

Once I enter values in first part I'll clicking the add button  it will take us to the stage 2 there will be also 4 input fields if I enter values in those and clicking on add button again mean it will take us to stage 3. 

the thing is I need to store the values in the input fields of all the 4 parts in single varibale

Can anyone please help me out to achieve this

Thanks in advance

Vishnupriya

address wizard.PNG


Hello Vishnupriya,


Step 1. 

You have to create a structure to include input values


Step 2: 

Add 4 local variables of data type "Address".


Step 3: 

Add Local Variable data type of Address Record List.


Step 4.

On Click action of "Add Address".

Append the input values to the Record list.

Increment the step counter as you already doing.


In the 4th stage, you will have all your values in "AddressRecordList" variable.

Use the same action for both the buttons by differentiating the buttons with one Boolean input parameter -> IsSave.

For the "Add Address" button pass "IsSave" as false.

For the "Save" button pass "IsSave" as true.

So that the action will execute the first flow of adding data to the list after that check the parameter "IsSave" is true or false.

If "IsSave" is true send the data through API.

You can validate the value for each address variable.

If (Address1.Address1 <> "") then append to list.

Similarly, for each address variable, you can do the same validation.

Hello Vishnupriya,

You can add a local variable of the record list (AddressRecordList).

On Click action of "ADD ADDRESS" append the input values to AddressRecordList.

In 4th stage use these list values to be stored in DB.


If you can share the oml, it would have been clear for me to explain the steps.


Regards,

Riyaz

Thanks Riyaz

But due to some security reasons I can't share the module. 

I didn't used any list widget in my code I just have four IF's for the each if I have set of input boxes. on clicking on add button I will just raise the currentstep number with the help of currentstep I'm just showing the respected IF input boxes. I need to give all the input boxes same variable and how to append it to a another list variable.

Code.PNG


Hello Vishnupriya,


Step 1. 

You have to create a structure to include input values


Step 2: 

Add 4 local variables of data type "Address".


Step 3: 

Add Local Variable data type of Address Record List.


Step 4.

On Click action of "Add Address".

Append the input values to the Record list.

Increment the step counter as you already doing.


In the 4th stage, you will have all your values in "AddressRecordList" variable.

Yes this is how I did before but the complication is If the User enter values for 2nd part and directly click on save button without clicking on Add button means it won't save the data of the 2nd address the list will have only values upto 1st address. filling of all 4 parts is not mandatory.

sometimes user can fill for 1st address and directly click on save button in that case the first address itself not saved in the list 

So I need the user to enter values whatever part they want and I need to save them in a single variable. it should include the last values entered even without clicking on the add button.  


Sorry if I got you wrong, in this scenario - the user can enter one or more than one address.

Can you share the entity structure - to know how you are saving the addresses?


Yes I have shared the screenshot of how the screen looks like also. the User can enter any number of address within 4. I need to pass the address values as list to the API. How can I achieve this.

addressstructure.PNG

Use the same action for both the buttons by differentiating the buttons with one Boolean input parameter -> IsSave.

For the "Add Address" button pass "IsSave" as false.

For the "Save" button pass "IsSave" as true.

So that the action will execute the first flow of adding data to the list after that check the parameter "IsSave" is true or false.

If "IsSave" is true send the data through API.

okay Riyaz I have created 4 address variables and assigned it to all the input boxes. Is there any was to append all the values in the list variable in single click. If the user doesn't enter value in any of the variables means it should append the empty values in the list.

Could you pls help me out how to append all the values in a list by clicking the save button.(should not append empty values).

Thanks and Regards

Vishnupriya

You can validate the value for each address variable.

If (Address1.Address1 <> "") then append to list.

Similarly, for each address variable, you can do the same validation.

You're Welcome. If you are able to solve your issues please mark it as a solution, which will help other members of the community find the answer quickly!  Thanks.  

Hi Riyaz sorry to bother you again and again mean while I have same set of 4 addresses in a wizard tool I have a API from there I'll be getting 4 set of addresses some times it will be one or two it depends.

I need to bind the Address from API to the input boxes of the wizard tool. The address will be coming as list I need to bind the [0] index address in navigation wizard 1 and [1] index address in navigation wizard 2 like wise till 4th address.

I used index values for binding the addresses in the respective wizard but its showing index out of bound error.

GETcustomerdetails.response.customers.current.address[0].Id

GETcustomerdetails.response.customers.current.address[0].address1

Like this I have used but there the is not even getting load and showing index out of bound error.

can you please help me out

Thanks

The method you are trying to get the value from the list by an index is wrong.

You need to use this structure.

GETcustomerdetails.response.customers[0].address.address1 


Try to get value using this structure.

If you cannot solve using this structure - send me the response structure details.

Here I'll be getting only one customer values with list of address then I need to use address[0] only right.

If you can send me the sample OML, it would have been easier for me to try and give you the solution.

For getting a particular value from the list by index, you have to replace the ".Current" by [index]


So,as an example, if you want the "Attribute" from a certain "Entity" from the second row from the aggregate "XYZ" you would use something like:

XYZ.List[1].Entity.Attribute

If "XYZ" is a single entity list you should use something like:

XYZ[1].Attribute
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.