Hi,
I have a collection that contains more than 6000 rows of data. I store all info using clearcollect.
Question: How to ForAll Patch exceeding 2000 rows?
Thought if it's possible to read more than 2000 rows using this formula :
ClearCollect(StoresList,Filter(CatalogueList,PartID <= 2000),Filter(CatalogueList,PartID >2000 && PartID <=4000),Filter(CatalogueList,PartID >4000 && PartID <=6000),Filter(CatalogueList,PartID >6000 && PartID <=8000));
Then maybe it's also possible to somehow patch over 2000 rows?
Thanks in advance.
Solved! Go to Solution.
The code I shared above will create a new entry in the database table each time it runs -- the Defaults(TestUpdate) argument takes care of that. If you need code that updates existing records or creates new ones, try this:
ForAll(UpdateList As aRecord,
With({aLookup: LookUp(TestUpdate, Title = aRecord.Title),
If(IsBlank(aLookup),
Patch(TestUpdate, Defaults(TestUpdate),
{
Title: aRecord.Title,
Description: aRecord.Description,
Quantity: Value(aRecord.Quantity)
}
),
Patch(TestUpdate, aLookup,
{
Quantity: Value(aRecord.Quantity)
} // If a record exists, update the quantity only
)
)
)
);
Note, you will need to clear your table or remove the duplicate records first.
Invalid numbers of arguments, received 3, expected 2. I thought that one of } is still open but can't figure out where.
Oops, my mistake (I was free typing). It is missing a "}" on the aLookup record
ForAll(UpdateList As aRecord,
With({aLookup: LookUp(TestUpdate, Title = aRecord.Title)},
If(IsBlank(aLookup),
Patch(TestUpdate, Defaults(TestUpdate),
{
Title: aRecord.Title,
Description: aRecord.Description,
Quantity: Value(aRecord.Quantity)
}
),
Patch(TestUpdate, aLookup,
{
Quantity: Value(aRecord.Quantity)
} // If a record exists, update the quantity only
)
)
)
);
Thanks, I was about to reply that i found a typo mistake.
This finally works.
Thank you so much for your efforts. You literally saved me as i was desperate that my app was almost finished but i couldn't get an update feature ready..
Thanks and enjoy your evening/night 😉
User | Count |
---|---|
161 | |
96 | |
76 | |
72 | |
59 |
User | Count |
---|---|
212 | |
166 | |
97 | |
95 | |
77 |