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 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
WarrenBelz
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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Did you miss the call? Check out the recording here!

Top Solution Authors
Top Kudoed Authors
Users online (26,454)