cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
hong_yip
Helper III
Helper III

How to group by and Concatenate from the first sharepoint list and then patch to second sharepoint list

i have sharepoint list (below), How to group by and Concatenate from the first sharepoint list and then patch to second sharepoint list

 

sharepoint list

workflowCheckNumPaidDate
SR-00029865432144475
SR-00029795432144475
SR-00029775448244475
SR-00029714515144475
SR-00029614515144475
SR-00029614515144475
CR-00126620000144475
CR-00126620000044475

 

 

 

result

workflowConcat
SR-000298654321 44475
SR-000297954321 44475, 754482 44475, 145151 44475
SR-00029614,5151 44475,  14,5151 44475,
CR-001266200001 44475, 200001 44475
2 ACCEPTED SOLUTIONS

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @hong_yip ,

The structure should be something like this

With(
   {
      wPatch:
      AddColumns(
         GroupBy(
            SPList,
            "workflow",
            "Data"
         ),
         "CheckNums"
         Concat(
            Data,
            CheckNum & " "
         ),
         "PaidDates"
         Concat(
            Data,
            PaidDate & " "
         )
      )
   },
   ForAll(
      wPatch As aPatch,
      Patch(
         SPList2,
         Defaults(SPList2),
         {
            workflow:aPatch.workflow,
            ConcatField:
            aPatch.CheckNums & ", " & aPatch.PaidDates
         }
      )
   )
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

@hong_yip ,

I cannot test this but the below should work

With(
   {
      wPatch:
      AddColumns(
         GroupBy(
            SPList,
            "workflow",
            "Data"
         ),
         "CheckNums"
         Concat(
            Distinct(
               Data,
               CheckNum
            ),
            Result & " "
         ),
         "PaidDates"
         Concat(
            Distinct(
               Data,
               PaidDate,
            ),
            Result & " "
         )
      )
   },
   ForAll(
      wPatch As aPatch,
      Patch(
         SPList2,
         Defaults(SPList2),
         {
            workflow:aPatch.workflow,
            ConcatField:
            aPatch.CheckNums & ", " & aPatch.PaidDates
         }
      )
   )
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

View solution in original post

4 REPLIES 4
WarrenBelz
Super User
Super User

Hi @hong_yip ,

The structure should be something like this

With(
   {
      wPatch:
      AddColumns(
         GroupBy(
            SPList,
            "workflow",
            "Data"
         ),
         "CheckNums"
         Concat(
            Data,
            CheckNum & " "
         ),
         "PaidDates"
         Concat(
            Data,
            PaidDate & " "
         )
      )
   },
   ForAll(
      wPatch As aPatch,
      Patch(
         SPList2,
         Defaults(SPList2),
         {
            workflow:aPatch.workflow,
            ConcatField:
            aPatch.CheckNums & ", " & aPatch.PaidDates
         }
      )
   )
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Hi anyone have solution ?

 

 

WarrenBelz

 

i want to do more , can i distinct concat record

 

run your code result

workflowConcat
SR-000298654321 44475
SR-000297954321 44475, 754482 44475, 145151 44475
SR-00029614,5151 44475,  14,5151 44475,
CR-001266200001 44475, 200001 44475

 

can i distinct concat reord

workflowConcat
SR-000298654321 44475
SR-000297954321 44475, 754482 44475, 145151 44475
SR-00029614,5151 44475,  14,5151 44475,
CR-001266200001 44475, 200001 44475

@hong_yip ,

I cannot test this but the below should work

With(
   {
      wPatch:
      AddColumns(
         GroupBy(
            SPList,
            "workflow",
            "Data"
         ),
         "CheckNums"
         Concat(
            Distinct(
               Data,
               CheckNum
            ),
            Result & " "
         ),
         "PaidDates"
         Concat(
            Distinct(
               Data,
               PaidDate,
            ),
            Result & " "
         )
      )
   },
   ForAll(
      wPatch As aPatch,
      Patch(
         SPList2,
         Defaults(SPList2),
         {
            workflow:aPatch.workflow,
            ConcatField:
            aPatch.CheckNums & ", " & aPatch.PaidDates
         }
      )
   )
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

 

 

thx, it's  work 

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (1,511)