Find double rows in excell, combine them and import excel
I made a possibility to import an excel file. This alle works fine, except..... The excel sheet has a colum UniekContractnummer. As you can see, sometimes the UniekContractnummer is the same on two (or more) rows. If so, then the 2 (or more) rows should be combined into 1 object. Is it possible to do so with a expression or something else in a microflow? I used the Find List Operation, but that doesn't solve the problem. Anyone ideas? Original subflow ContractList_toCommit is target entity ContractNPList is non persistant entity The FindKlant: used to find if the UniekContractNumber allready excist in target entity The FindContract: used to find the double Contracts (as I learned now, this should be a Filter operation) Create Object? is to decide whether the Contract should be created $Contract = empty and $FindContract = empty Create Contract is to create the contract with all of its attributes Change FindKlant is to set the contract to the user Add to list is to add the created contract to the ContractList_toCommit Microflow after I changed it Change activity Edit 7 feb 2024 The merging works, only it duplicates. The second row shouldn't be there. Microflow to merge two rows
First a question:
Is this double row also a double row in the Excel itself?
I always import my excel data in a temporary entity, before I store it on my target entity
Create a separated module for your Excel import
Add an entity which mimics your target entity (CTRL-C CTRL-V works ;-) )
Use this entity for your import
Create a microflow which handles the transfer from your import entity to your target entity
This microflow can handle the merge of the duplicate rows
Retrieve the list of the import entity
Create a empty list of the target entity
Loop through the list to create the target object & map the values
Add the new object to the target entity list
Before you create the new target object, add the list operation/find
if found don't create or merge them with a change object
if not found create
Hope this helps
Rene van Hofwegen
Rather than a find, you likely want a filter action, since a find only returns one object while you said there might be more rows. The filter action should return a list of all rows with the same contract number, which you can then use to create one object out of (create one object, then iterate over the list to fill the attributes).
Make sure not to process the rest of the rows you've already processed again, otherwise you will get duplicate objects.