Hi Guys!
I have a problem comparing two lists. I apologize, as I cannot share the OML, as it is the company's business
I have a ListStructA that I need to compare to find out if the values exist in an aggregateB and this comparison cannot be by id but by name because of the application rule.
there will be no standard for the sizes of the lists or aggregate, as the values are constantly changing.
I created a for each for structA and inside the cycle I put an aggregateB with the condition of StructA.Name = AggregateB.Name and then an IF to check if the value came empty.
when the value comes empty I will insert the information and when not I will update it.
however the value of the aggregate does not update only the ListFilter.
What I need is to run a list that turns into Excel where the values can be repeated or not, and in this case I need to make updates or insertions line by line, and in Excel not the ID numbering of the aggregate.
Please formulate your question more clearly. What goes wrong?
what i want to do:
my flow:
Daily I will upload an excel table, where I insert it into a struct, and then check if it already exists in the table and update it, if not, I insert it.
The problem in my code is that it seems that the aggregate is always in the first record while the for each traverses the struct.
and I also don't know if this would be the best solution
Hello,
You can use list filter to check if the list of aggregate has value or not. If listfilter.filteredlist.Empty then you can add or else you can update.
I got it. you are not using Foreach in second aggregate(GetContentoresBY...) so you will be always get Current record which will be first record of the aggregate. what you can do is, use another foreach loop for second aggregate and now match with first loop data.
Basically you have 2 aggregates and you have to perform check for each of element of these 2 aggr so you have to create 2 loops, 1st loop will be outer loop where you have to take 1st element then for this 1st element you have to loop through all elements of second loop.
Hi,
Are you doing this in a client action or server action?
I think what you need is to refresh before aggregating to the aggregate , (this load with the new value in the aggregate)
I'm using a server action, and in this case it would be adding to the aggregate, but I'm not succeeding
Hi Guys
I did it, I changed the list filter inside the for each cycle to aggregate and I managed to execute.