cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AVTS
Post Partisan
Post Partisan

Exclude the Duplicates - Collection to Dataverse Table

Experts .  Duplicate entry is patching from collection(fs_odometerout) to Dataverse(fsodometer) table . Which is the best way to avoid this. Distinct or GroupBy. Please give me few example. 

 

Following my coding , 

 

GroupBy(fs_odometerout,"routedate") ;

ForAll(
fs_odometerout,
Patch(
fsodometer,
Defaults(fsodometer),
{
sno:"",
route:route1,
start:startday1,
End:endday,
routedate: routedate
}
)


);

1 ACCEPTED SOLUTION

Accepted Solutions
Drrickryp
Super User
Super User

@AVTS 

Neither, filter the collection first, then patch

 

With({fso:  Filter(fs_odometerout,
                                  Not(routedate in fsodometer.routedate)
    },

  ForAll(
          fso,
             Patch(
                     fsodometer,Defaults(fsodometer),
                                  {
                                  sno:"",
                                  route:route1,
                                  start:startday1,
                                  End:endday,
				  routedate: routedate
                                 }
             )
)

 

 

View solution in original post

2 REPLIES 2
Drrickryp
Super User
Super User

@AVTS 

Neither, filter the collection first, then patch

 

With({fso:  Filter(fs_odometerout,
                                  Not(routedate in fsodometer.routedate)
    },

  ForAll(
          fso,
             Patch(
                     fsodometer,Defaults(fsodometer),
                                  {
                                  sno:"",
                                  route:route1,
                                  start:startday1,
                                  End:endday,
				  routedate: routedate
                                 }
             )
)

 

 

thank you .. it worked

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (1,741)