cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PDG
Level: Powered On

Help Remove Specific String from Sharepoint List

Short version:

How do I remove set a variable equal to "0001" and remove the variable from this label text: "0001, 0002, 0003"

 

Long version: 

I'm working on building a simple inventory system. The inventory items have two specific ID numbers, both of which need to be maintained together to be roughly: "IDnumber1.IDnumber2"

 

The database has a number of locations in which the inventory can be stored and the inventory can be split up. So, for example, one ID#1.ID#2 can be applied to four locations and each location can have four ID numbers applied to it. 

 

What I'm trying to do is use concat, ismatch, or whatever combination of functions I need so that if someone removes an ID.ID number from a location, I would search for the current string of ID numbers and remove ONLY that license.id from that sharepoint list column. 

 

If I had a label that equaled "0001, 0002, 0003", how would I use concat/ismatch to remove only "0002" from the equation? In addition, is there a way I can set the formula to look for a variable instead of a specific text?

 

E.g. Concat(Filter(Split(Label21.Text,""),IsMatch(Result, ExampleVariable)),Result)

 

Right now the above function does not work regardless of how I try to call 'examplevariable', however if I replace it with "0001" it works, and if I replace it with "0002" it does not work. Would i also need to use a sort function to look through more than just the first entry?

 

obviously, I'm a little lost in this. Any help is appreciated. 

 

DB is setup to have only two columns, one for location and one for the license.id numbers. 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Help Remove Specific String from Sharepoint List

Hi @PDG ,

Based on the formula you provided, I think there is something wrong with it. The second argument of the IsMatch function must be a TextFommat enum or a regular expression (constant values), it could not be variable value.

 

So within the second argument of the IsMatch function, you could not place a variable. Please consider modify your formula as below:3.JPG
Please take a try with the following formula:

Concat(
Filter(Split(Label21.Text, " "), !StartsWith(Result, ExampleVariable)),
Result & " "
)

In addition, I think the Substitute function could also achieve your needs. Please also take a try with the following formula:

Substitute(Label21.Text, "0002, ", "")

Please take a try with above solution, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Dual Super User
Dual Super User

Re: Help Remove Specific String from Sharepoint List

Hi @PDG 

 

looking at the short story only 🙂

Substitute("0001,0002,0003","0002","")

 

Use substitue function and replace the text with empty string

Community Support Team
Community Support Team

Re: Help Remove Specific String from Sharepoint List

Hi @PDG ,

Based on the formula you provided, I think there is something wrong with it. The second argument of the IsMatch function must be a TextFommat enum or a regular expression (constant values), it could not be variable value.

 

So within the second argument of the IsMatch function, you could not place a variable. Please consider modify your formula as below:3.JPG
Please take a try with the following formula:

Concat(
Filter(Split(Label21.Text, " "), !StartsWith(Result, ExampleVariable)),
Result & " "
)

In addition, I think the Substitute function could also achieve your needs. Please also take a try with the following formula:

Substitute(Label21.Text, "0002, ", "")

Please take a try with above solution, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 452 members 6,564 guests
Please welcome our newest community members: