Cannot read property "length" from null
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2022 01:45 PM
I have written a script to find some specific content from all HTML fields from knowledge articles but getting below error when there is not specific data in one of the field, not sure what should I write so that it can run only when there is at least 1 matching record in 1 of the HTML field.
- Labels:
-
Knowledge Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2022 12:23 PM
The syntax I know and have used for years is gr3.<field_name>. I see no way that 'str = gr3[txt]' would return anything valid. Please comment out the line that produces an error and see what your 'gs.print("data in field" + str);' shows.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2022 12:25 PM
Also, the line that initializes 'var regex' should probably use values enclosed in quotes. And you may have to "escape" some. I don't practice regex.