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

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
v-xida-msft
Community Support
Community Support

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
RezaDorrani
Dual Super User II
Dual Super User II

Hi @PDG 

 

looking at the short story only 🙂

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

 

Use substitue function and replace the text with empty string

v-xida-msft
Community Support
Community Support

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
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

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.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (2,169)