removing an element from an array passed into a function
Options
![mohan ramanujam](https://us.v-cdn.net/6037124/user_avatars/4156573.jpg)
mohan ramanujam
Member ✭
i am passing an array to a function. Inside the function i want to remove a particular item from the array and then pass it back. There is more logic to it but in essence. I am trying to use update variable with remove filter but that only shows me those variables defined locally to use for the array. I need to use the input array which is not shown in the drop down var selector. I don't want to duplicate the entire array in a local array variable. What are my options
Comments
-
update variable only works if you have a variable to update. Alternatively, you could use create variable and apply the remove filter there to do it in one step.
-
do i then have to replicate the input array into the locally created variable. If so what is the easiest way to replicate. It would seem to be wasteful as i really wanted to filter the input variable.
-
No... You just need to select the input as the value for the variable and apply the filter to it:
[CleanShot 2022-10-05 at 13.51.53.png] -
I am getting null arrays in my create variable with remove. Please see following two screenshots
[FireShot Capture 173 - Xano - api2.zwsociety.com.png][FireShot Capture 174 - Xano - api2.zwsociety.com.png] -
any tips on why null array is happening on the create variable (see above)
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