Search for a list of character strings in Text File or Json
Options
Victor Morgan
Member ✭
I have two data-sets that I'm attempting to relate. Data Set 1 contains a list of strings in column A and the list of corresponding numbers for those strings in column B. Data-Set 2 is a text file (from a json result).
I'm unsuccessfully attempting make a list of 1B results if 1A exists in Data-set 2.
I can use "query all records" to search for a single, static name (from 1A) exists in Data-Set 2 and it returns the corresponding data from 1B.
Do I need to put this in a loop to search for all items in 1A, can I just provide a list, or do I need to do something else entirely?
When I attempt to search for more than 1 item on the list I receive this error: "Exception: ParseError:"
I'm unsuccessfully attempting make a list of 1B results if 1A exists in Data-set 2.
I can use "query all records" to search for a single, static name (from 1A) exists in Data-Set 2 and it returns the corresponding data from 1B.
Do I need to put this in a loop to search for all items in 1A, can I just provide a list, or do I need to do something else entirely?
When I attempt to search for more than 1 item on the list I receive this error: "Exception: ParseError:"
Comments
-
Hey can you provide some screenshots of your two data sets: 1 and 2? I need a little clarity of the two things you are trying to compare...
At first, it sounds like you can use the array function Find All Elements for dataset 1B
Where
$this.whatever_field | IN | dataset 1A
=
true -
I experimented with the $this.whatever_field | IN | dataset 1A but didn't have "IN" as an option.
This is dataset 1, with columns A and B.
[image.png]Dataset 2 is ideally a json file, single text block, or, if required, a list of text.
[image.png][image.png]
The goal is to go down all of the items in dataset 2, find the corresponding value in dataset 1 in the "Name" column, and return the corresponding "Number" value.
In this example, the desired output would be:
1
4
6
1 -
It seems like "Query all records" and the following filter would work the best (searching for the DataSet1.Name in the dataset2_textlist and then returning the corresponding DataSet1.Number), but I'm getting the following error.
[image.png][image.png] -
I'm not allowed to create an array manually either. When typing in an array ["a", "g", "f"], it doens't save and reverts back to []. The input of [] runs without errors, but does not find matches.
[image.png] -
I think that I got it. I needed to use "By Joins" to reference both data-sets/tables.
-
IN is a filter within the Array function Find All Elements not an operator
-
You can create an array manually if you use the import JSON feature on the drop down (Action > Import JSON)
-
Hey I'm having the same issue on my end as well
This is what my output looks like. In this example I want to filter for rows where "cancer_focus" contains the cancer_diagnosis_id "7". [image.png]When I tried to use the conditionals in my search (i.e. cancer_focus CONTAINS "7") it returns a blank value. I use the Safe Array filter to convert my value to an array in order to compare but it still returns blank. -
since your cancer focus field is an object array, you first need to bind the object array, which will then give you access to the individual fields within it to filter. Once you do so, I believe an equals operator would be used.
Categories
- All Categories
- 53 ? Announcements
- 47 ? Releases
- 37 ? Welcome
- 983 ? Help! I'm a Noob
- 125 ? No-Code Front-Ends
- 633 ? Working with APIs
- 439 ? Transforming data
- 126 ? Connect Xano to ...
- 50 ?? Find an Expert
- 348 ❓Other questions
- 35 ? Security
- 22 ✂️ Snippets
- 19 ? Showcase
- 7 ?️ Xano Chatter
- 62 ? Video Tutorials
- 171 ? Request a feature
- 229 ? Report a Bug
- 19 ? Templates & Extensions
- 7 ? Feedback