Notifications
Announcements
No record found.
Hi ,
I have an arraylist ["1700",1701","1702","1703"] and selected value is "1700" .
I want to a method to return another arraylist with all the possible combination of a given arraylist in PORTALS.
Please help me with this.Thanks in advance!!!
Output:
1700
1700,1701
1700,1702
1700,1703
1700,1701,1702
1700,1701,1703
1700,1702,1703
1700,1701,1702,1703
Regards,
Susritha
Hi partner,
Actually you are asking for an algorithm.
Please refer to the following code.
//set original arraylist var arry=["1700","1701","1702","1703"] var num="1700"; function combination(){ var result; var orgresult; var copyarry=arry.slice(0); copyarry.splice(copyarry.indexOf(num),1); for(let i=1;i<= 0 || size === 0) { result.push(rootArr); return; } for(let i=0; i<= remainArr.length-size; i ) { const root = remainArr[i]; const other = remainArr.slice(i 1); createTree(rootArr.concat(root), other, size - 1); } } createTree([], arr, size); return result; }
Best Regards,
Leo
Hi Leo,
I want to use that algorithm in portals web Template liquid Language.Is it possible to use functions in web Template.
Susritha,
Sorry that I'm not very familiar with Liquid, you could refer to the liquid details and transfer the JS into liquid.
docs.microsoft.com/.../liquid-objects
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Tom_Gioielli 49 Super User 2025 Season 2
Daniyal Khaleel 27 Most Valuable Professional
Soundari 15