Question
Hopkins Software Pvt. Ltd.
IN
Last activity: 15 May 2023 11:12 EDT
How to Create a table based on some inputs values?
Hi Everyone,
My requirement is to Create a table based on some inputs values. I Have "Number start" and "Number End" inputs. If fill data like Number start=1 number end=6 below image
Then Click on Add Button. The Table was created based on above Input values like below image
Then clear all values. The table was created when Fill start no=4 and end no=14 Output Table like below image
Anyone please tell me how to achieve this
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Updated: 14 May 2023 1:48 EDT
Bits in Glass
IN
@Nagarjuna Saidu In step 3 property-set, after S. No=Temp.numberstart. You can set temp.numberstart = temp. numberstart= temp. numberstart+1.
You can also maintain this counter using a param. Counter (of integer type). After S.no property set, you can set temp. Numberstart to a param. Counter, then you can increment by 1.
Bits in Glass
CA
You can use for loop in an activity or you can create a recursive Data transform.
You can write a small java function as well, but it is not advisable.
Updated: 12 May 2023 6:01 EDT
NCS Pte. Ltd
SG
Hi @NagarjunaS16644648: Hope the table is sourced with a page list property. This would be a data manipulation to add new pages into the pagelist. Looking into this this is a for loop, so you may need to use activity in the refresh action of add button to use for loop and append new page into the page list.
Technically this can be done using data transform too.
Let us know if you are facing issues in the implementation.
Thanks.
-
Nagarjuna Saidu
Hopkins Software Pvt. Ltd.
IN
@ArulDevan Can You tell how create activity to achieve this?
Bits in Glass
IN
@Nagarjuna Saidu in the activity, you have option -> for loop
It'd like i =n, I<=n
You can get the user input and use these values in the for loop....
You can append these results to your pagelist which is sourced to table layout.
-
Nagarjuna Saidu
Hopkins Software Pvt. Ltd.
IN
@Anoop Krishna Bro can you tell me activity and data transfer both ways
Bits in Glass
IN
@Nagarjuna Saidusure, for achieving for loop activity is easier. In the activity if you see for loop you will get to know how to do it. For loop expects starting and ending number which is entered by user.
So you pass those starting and ending values from user to the activity as parameter and use that in for loop.
Now within the loop, if its 1 to 5, data will be looped from 1 to 5 within the loop. You just need to get that data. That is by-> within the for loop you need to append each of the data to the pagelist. So your pagelist will have 1-5 records.
Now the table sourced with that pagelist will have this data.
-
Nagarjuna Saidu
Updated: 13 May 2023 5:00 EDT
Hopkins Software Pvt. Ltd.
IN
@Anoop Krishna But I don't have much knowledge on activities. If you don't mind can you tell me step by step ? One more how increase knowledge on activities and data trasfer
Bits in Glass
IN
@NagarjunaS16644648 you can become good activities and DT by practice. With whatever steps I have provided, try to implement using activity. Then if you are stuck anywhere, you can post your doubts. Then you will understand activities and DT more
-
Nagarjuna Saidu
Hopkins Software Pvt. Ltd.
IN
Please tell me this is correct or not and any missing steps
Bits in Glass
IN
@Nagarjuna Saidu ya this is correct 👍.
-
Nagarjuna Saidu
Updated: 13 May 2023 14:13 EDT
Hopkins Software Pvt. Ltd.
IN
@Anoop Krishna But S.NO not comes when run the activity.
No SNO for all records and Apply this activity OnCLick of Add Button. But only one record was added into table No Start=1 No End=6 when click ADD button
Bits in Glass
IN
@Nagarjuna Saidu Can you trace the activity on click of button? And check if data is getting copied to your pagelist. Action should be like->
On click-> Refresh this section(within that call your activity)
Also check if parameter is getting passed from your section to your activity. Define your parameters in parameter tab and pass parameters from the place where you are calling this activity(refresh this section).
-
Nagarjuna Saidu
Hopkins Software Pvt. Ltd.
IN
@Anoop Krishna Hi Bro. It's working. But Primary.InstituteDataPL(<APPEND>).FromSNO=temp.NumberStart
I need modify this step because if temp.NumberStart=1 then S.NO=1 is in every page of page list. I need 2nd page s.no=2, 3rd page s.no=3....
one more if start No=7 then S.No starts from 7 then next page 8... Like below Images
table like this below
Accepted Solution
Updated: 14 May 2023 1:48 EDT
Bits in Glass
IN
@Nagarjuna Saidu In step 3 property-set, after S. No=Temp.numberstart. You can set temp.numberstart = temp. numberstart= temp. numberstart+1.
You can also maintain this counter using a param. Counter (of integer type). After S.no property set, you can set temp. Numberstart to a param. Counter, then you can increment by 1.
Hopkins Software Pvt. Ltd.
IN
In step 3 property-set, after S. No=Temp.numberstart. You can set temp.numberstart = temp. numberstart= temp. numberstart+1.
This working fine. I am not understand this
You can also maintain this counter using a param. Counter (of integer type). After S.no property set, you can set temp. Numberstart to a param. Counter, then you can increment by 1.
Bits in Glass
IN
@Nagarjuna Saidu if you don't want to use temp. Numberstart directly, you can set it to a param and increment that param and you can set that param to Sl. no.
-
Nagarjuna Saidu
Hopkins Software Pvt. Ltd.
IN
@Anoop Krishna Thank You very Bro. Can you achieve this with data transfer. If it possible can you tell steps of data transfer
Thank Very Much Mr.Anoop Krishna
Hopkins Software Pvt. Ltd.
IN
Thank You very Bro. Can you achieve this with data transfer. If it possible can you tell steps of data transfer
Bits in Glass
IN
@Nagarjuna Saidu can you check in pdn how to do for loop in data transfer. For loop mechanism is only different, logic is same. For loop in DT is not direct like activity.
-
Nagarjuna Saidu
NCS Pte. Ltd
SG
Hi @NagarjunaS16644648:
Step 1: Property set - Set the Number start and number end in parameter (Integer)
Step 2: In loop select for loop, in minimum and maximum use the parameter set in step 1 and increment as 1. Step method is as property set. Expand method and set. YourListProperty(<APPEND>).Your propertyname with value (Sno). In the same method add item to set the other properties using (<LAST>) instead of append keyword so that it will set in the same page.
Please try this and let us know if you are facing issue.
Thanks.
-
Motukatla Harsha Vardhan
Hopkins Software Pvt. Ltd.
IN
@ArulDevan If start no= 7 then s.no starts with 7. How to do this?
NCS Pte. Ltd
SG
Hi @NagarjunaS16644648: You can set start number in a parameter and can use with in the loop. Increment the parameter for each loop.
Thanks.