cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
Super User III
Super User III

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
Super User III
Super User III

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
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (69,046)