Forum Discussion
Dicken
1 year agoPost Prodigy
LIst Generate ; to insert at given position
H, is there a way to use List.Generate to insert a null , at a given position, so here I have to ways to calculate the positons, one gen one accer ; Inserting 2 places; let alist = {"...
- Anonymous1 year ago
Hi Dicken ,
Just wanted to check and make sure everything is working good with the solution you shared. It looks like a solid approach, and I am really glad you found a way to use List.Generate to solve your issue.
Is it meeting your needs so far? If there is anything else you would like to adjust or if you run into any other challenges, feel free to reach out .We happy to help further.
Thank you.
Dicken
1 year agoPost Prodigy
How are these list.generate, which is what was asked. i do like the
List.Transform / many , but I wanted to use generate if possible, if it's not possibel that's fine.
lbendlin
1 year agoSuper User
let
alist = {"A".."Z"} ,
itemlist = {"D", "K", "N"},
blist = List.Combine(List.Generate(()=>0,each _ < List.Count(alist),each _+1,each if List.Contains(itemlist,alist{_}) then {null,alist{_}} else {alist{_}}))
in
blist