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.
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:
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,
Hi @PDG
looking at the short story only 🙂
Substitute("0001,0002,0003","0002","")
Use substitue function and replace the text with empty string