Hello everyone, I have created a collection list, but now I want to sort it according to the order I have written them in collection. Code: [Collection: Ns Time] Title : "Student Timings" List Name : "7 AM", "8 AM", "9 AM", "10 AM", "11 AM", "12 Noon" , "1 PM", "2 PM", "3 PM", "4 PM", "5 PM", "6 PM", Align : Right Full Height : Yes Format : $Name, 10 But its coming as : I want it as 7 Am to 7 PM in order
Do it like this [Object:a] Name:"7 AM" SortIndex:1 [Object:b] Name:"8 AM" SortIndex:2 [Collection:ListOfMyObjects] Object:a,b Sort@Default:$SortIndex
This is great but u need to learn more on how to fetch collections using tdl codes. Creat the values (7am to 8am) in tally database and fetch these values using collection to the desired field
This method will be long when the list items are in the last quantity. Please provide any short way if possible.
Yes, This method would be long if you have many items So, The shortest way would be using "DateTime" Data type of tally in which User can enter time easily [Field:abc] TypeateTime
[Collection: Ns Time] Title : "Student Timings" List Name : "1. 7AM", "2. 8AM", "3. 9 AM", "4. 10 AM", "5. 11 AM", "6. 12 Noon" , "7. 1 PM", "8. 2 PM", "9. 3 PM", "10. 4 PM", "11. 5 PM", "12. 6 PM", Align : Right Full Height : Yes Format : $Name, 10 You can use $$Number and $$stringPart function in compute to display only 7 AM , 8 AM etc in collection
This should work Code: [Collection: Ns Time Src] List Name : "01. 07 AM", "02. 08 AM", "03. 09 AM", "04. 10 AM", "05. 11 AM", "06. 12 OO" , "07. 01 PM", "08. 02 PM", "09. 03 PM", "10. 04 PM", "11. 05 PM", "12. 06 PM", Fetch : Name [Collection: Ns Time ] Source Collection : Ns Time Src Title : "Student Timings" Compute : Name : $$StringPart:$Name:4:(($$StringLength:$Name)-3) Format : $Name, 10 Compute : NameIndex : ($$StringPart:$Name:0:3) Table Sort : $$Number:$NameIndex Full Height : No