The Lansweeper Community will be under construction as of March 2nd, 2026. This site will move to a static version—join us on Reddit to keep the conversations going. More info here.
Community FAQ
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
swright
Engaged Sweeper III

I need to list assets with name starting with mag.  Using the like filter will pull any name with "mag" in the name.  I'm trying to use the REGEX filter, but having errors with the value.  I also need the regex to be case insensitive.

"/^mag/gmi" works with a regex tester, but not in Flow Builder.  Anyone have regex examples?

 

 

1 ACCEPTED SOLUTION
Vicente_SC
Moderator
Moderator

The REGEXP operator in the List of Assets filter uses regular expressions in Lucene format. However, I tried this case, and it is working as a LIKE operator instead of checking the regular expression. We need to investigate this topic further. We will let you know once we have more details.

In the meantime, there is another option, which is using the Filter action, right after the List of Assets action. Here is an example of the filter expression you can use for your case:

(item, index) => { return /^mag/i.test(item.assetBasicInfo.name) }
 
Flow builder Filter.png
 

View solution in original post

3 REPLIES 3
Vicente_SC
Moderator
Moderator

@swright, we found the way to filter asset names starting with a string using the filters fields in the List of Assets action. You can use the expression "^mag" for that.

filter assets.png

 The format used in that filter option can be found here: https://github.com/google/re2/wiki/syntax. We will update our documentation to make it clearer.

However, we are also planning to improve the usability of the filtering options for the Lansweeper connector in the future, so adding pre-filtered data in the Flow builder will be easier and more user-friendly.

Great feedback and stay tuned!

Vicente_SC
Moderator
Moderator

The REGEXP operator in the List of Assets filter uses regular expressions in Lucene format. However, I tried this case, and it is working as a LIKE operator instead of checking the regular expression. We need to investigate this topic further. We will let you know once we have more details.

In the meantime, there is another option, which is using the Filter action, right after the List of Assets action. Here is an example of the filter expression you can use for your case:

(item, index) => { return /^mag/i.test(item.assetBasicInfo.name) }
 
Flow builder Filter.png
 
Jacob_H
Lansweeper Employee
Lansweeper Employee

hm i can't get that to work either - I'll bring it up to the product team as I think it might not work right in the connector.  a workaround is to use the 'branch on expression'  - you can see an example if you make a workflow with the template 'Change Asset Location'

Forum

New to Lansweeper?

Try Lansweeper For Free

Experience Lansweeper with your own data.
Sign up now for a 14-day free trial.

Try Now