cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Qb00ne
Frequent Visitor

Remove\edit\add part of text from Gallery which is using SharePoint list

Hi guys,

 

I am struggling with removing\adding\editing items in my Gallery. In SP list in one cell I have set of user skills separated by "," . To achieve nicely looking gallery I used Split function in Item as per below code. To display all the items I used label and in Text field I have ThisItem.Result. Right now my I am trying to somehow remove, add and edit these items in my gallery. Is there anyway to get this done?

 

Split(
    Left(
        LookUp(
            Users,
            Email = User().Email
        ).Skills,
        Len(
            LookUp(
                Users,
                Email = User().Email
            ).Skills
        ) - 2
    ),
    ","
).Result

 

Gallery output: 

2020-12-04_09-34-14.png

 

 

 

 

 

 

 

 

 

Thank you in advance, 

Qb00ne

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @Qb00ne ,

This is free-typed, so watch commas/brackets, but I think you need to do something like this.

UpdateContext({varUserMail:User().Email});
With(
   {
      wSkillList:
      With(
         {
            wSkills:
            LookUp(
               Users,
               Email = varUserMail
            ).Skills
         },
         Left(
            wSkills,
            Len(wSkills)-2
         )
      )
   },
   ClearCollect(
      colSkills,
      Split(
         wSkillList,
         ", "
      )
   )
);
RemoveIf(
   colSkills,
   YourDeleteValueName=Result
);
Patch(
   Users,
   {Email:varUserMail},
   {
      Skills:
      Concat(
         colSkills,
         Result & ", "
      )
   }
)

 

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

4 REPLIES 4
WarrenBelz
Super User
Super User

Hi @Qb00ne ,

This is free-typed, so watch commas/brackets, but I think you need to do something like this.

UpdateContext({varUserMail:User().Email});
With(
   {
      wSkillList:
      With(
         {
            wSkills:
            LookUp(
               Users,
               Email = varUserMail
            ).Skills
         },
         Left(
            wSkills,
            Len(wSkills)-2
         )
      )
   },
   ClearCollect(
      colSkills,
      Split(
         wSkillList,
         ", "
      )
   )
);
RemoveIf(
   colSkills,
   YourDeleteValueName=Result
);
Patch(
   Users,
   {Email:varUserMail},
   {
      Skills:
      Concat(
         colSkills,
         Result & ", "
      )
   }
)

 

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

Thanks @WarrenBelz

I managed to adjust the gallery using your code. Now I have some other issues while using Patch, please see the screenshot below. I am an owner of the sharepoint and do not have any issues with writing things to all the lists. 

Is there any workaround to write the collection to Skills column? Or any other workaround?

Qb00ne_0-1607097757085.png

 

This PowerApps stuff is still new for me 🙂 

 

Hi @Qb00ne ,

You have a compulsory field "Security_x0020_Role that is obviously blank. A bit strange on an existing record though.

You could solve this by removing the requirement for data to be present, but better to sort out why it is blank if you need it.

 

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.

Thank you @WarrenBelz! I managed to figure it out 😊 

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

secondImage

Power Apps Community Call

Please join us on Wednesday, October 20th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (1,955)