Reply To: Liste sharepoint > 2000 éléments

  • Jean-Rémy

    Member
    8 novembre 2022 at 13h04

    En synthèse il faut :

    • identifier le nombre d’éléments dans la liste via l’ID

    • définir le nombre d’itérations à faire pour tout parcourir

    • récupérer les éléments par blocs pour alimenter une collection

    Calculer le nombre d’itérations

    Set(n    firstRecord;n    First('Large List')n);;nSet(n    lastRecord;n    First(n        Sort(n            'Large List';n            ID;n            Descendingn        )n    )n);;nSet(n    iterationsNo;n    RoundUp(n        (lastRecord.ID - firstRecord.ID) / 500;n        0n    )n);;nCollect(iterations, Sequence(iterationsNo,0));;

    Alimenter la collection en parcourant les itérations

    ForAll(n    iterations;n    With(n        {n            prevThreshold: Value(Value) * 500;n            nextThreshold: (Value(Value) + 1) * 500n        };n        If(n            lastRecord.ID > Value;n            Collect(n                LargeListSP;n                Filter(n                    'Large List';n                    ID_val > prevThreshold && ID_val <= nextThresholdn                )n            )n        )n    )n);;

    Il y a un bon article qui présente la problématique et détaille l’implémentation : https://poszytek.eu/en/microsoft-en/office-365-en/powerapps-en/overcome-2000-items-limit-using-power-apps-collect-function/

    CommentID=jsrE94NpaFhhZO4, PostID=Y5l7UJIE06Q4MIt