Can I set a value based on a condition within a filter?

Options

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

  • Michael Udinski
    Michael Udinski Administrator

    ADMIN

    Options
    Try the set_conditional filter

    Path: Variable X

    Value: True

    Conditional: "string1"
  • Jay
    Jay Member
    Options
     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.
  • Jay
    Jay Member
    Options
    cc  
  • Jay
    Jay Member
    Options
     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. 
  • Michael Udinski
    Michael Udinski Administrator

    ADMIN

    Options
     here's a quick tutorial on how to use this filter:

    
  • Jay
    Jay Member
    Options
     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?
  • Michael Udinski
    Michael Udinski Administrator

    ADMIN

    Options
     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
  • Jay
    Jay Member
    Options
    Still having issues here. Getting an error for this:
    [image.png]
    {"code":"ERROR_CODE_INPUT_ERROR","message":"Invalid boolean input.","param":"Creator_Is_Author"}