Error "Text filter requires a scalar value" when looping through array
I want to loop through an array of teams:
["Sales",
"Management"]
For each item in the array, I want to create a new team in my Team table. However I can't seem to get to the team name when creating the teams.
When I refer only to the item in the array, I get an error "Text filter requires a scalar value".
I've already tried a different way by adding a filter 'first'. Then I don't get the error and the two teams are created however the name of the team is empty because there is no text coming from the arry item…
How can I get to the text value of each item in this simple array?
Thank you for your valuable insights!
Best Answers
-
Hi there,
The variableteamItem
is an object with the record with all the fields/path. What you want is only one path, which is the name. So, you just have to assign the valueteamItem.name
as the input name. -
Hi Louis,
Thanks for your feedback!
However the array is actually just a list of text strings (not objects).
So I can't target
teamItem.name
because teamItem does not have a path "name".How should I approach this?
Thanks again so much!
-
I see. I saw the input as an 'object' type, and I jumped to conclusions. Just modify the input from object to text and as a list, and it should work.
-
So simple, yet so brilliant!
Thanks very much Louis!
Answers
-
Glad to help!
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