Can I set a value based on a condition within a filter?
Options
![Jay](https://us.v-cdn.net/6037124/user_avatars/2364889.jpg)
Jay
Member ✭
There are a bunch of variations for this but I am specifically looking for doing these two:
Edit record from Posts:
[image.png]
Within here I want to basically say:
If Variable X = "string1" set value to True
And here:
[image.png]
If Variable Y = "string2" set value to Variable Y
Are these possible or do I have to create a conditional line in the function list for each?
Comments
-
Try the set_conditional filter
Path: Variable X
Value: True
Conditional: "string1" -
Still struggling with this.
I have a Users table, and a user has an email column
I have an Old_Posts table, and a post there has a Creator column (which is an email address)
I want to create a new record in a new/different Posts table:
Here I want to set the creator to be the ID of the user from the user table, and that user is a user record whose email matches the Old_Post Creator email.
So something like this:
[image.png]
I am not clear on how to do this. -
cc
-
I think there is no way to do it here, as far as i can tell. I have to in a loop, separately query the user table, filter for users' whose email is a match and then assign that user id to the post creator.
-
here's a quick tutorial on how to use this filter:
-
Thanks, that's helpful.
I think part of what is confusing about the interface is that its never really clear or coherent what the logic is when conditions are nested within filters (for one, the word filter implies something that isn't always what is being done). It's not always clear what is being returned, or what is being constructed.
It's kind of like looking at an equation, and trying to sort out which part happens first based on seeing what operation is within what braces, plus remembering the rules of what happens when. If that makes sense.
Until seeing your example, i thought the condition is being check against the path, so here it would be if Bubble_Notification.Acknowledged equals "yes":
[image.png]
But it sounds like the condition should be Bubble_Notification.Acknowledged filter by equals to yes, right? -
I'm having trouble understanding your question... the set_conditional filter is setting a path within an object based on a conditional... think of it like the set filter but based on something that must be true (conditional).
The path is the path within an object you will set if something is true.
Your path will most likely be a static text.
The conditional is where if something is true then the path will be set to whatever is on the value line.
The conditional should use filters to create the conditional statement. So you might have
Conditional: some_variable | equals | yes
Which would say "if some_variable = yes"
If that above statement is TRUE then the path defined within the object is SET with the value provided -
Still having issues here. Getting an error for this:
[image.png]
{"code":"ERROR_CODE_INPUT_ERROR","message":"Invalid boolean input.","param":"Creator_Is_Author"}
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