Set Conditional on an Add/Edit Record function

Options

Hello there,


I've got a Set conditional function (as per below) that seems to work well when I'm doing an Add a Record in my Xano table.

The GET (SentToContact) is from an API call response.


Now there are actually three values that this field could be. They are Not Sent, Scheduled, and Sent.


Now my question is around me wanting to use the Add/Edit Record function on my Xano table.

Let's say I set it up, and for examples sake as the workflow goes through it's steps, it finds a matching record in my current Xano table.

How can I set a conditional that if Xano does find a match in my table, I can check what the current value of sendStatus is, and if value = Scheduled, do nothing, but if value is anything other than Scheduled, it applies the exact conditional filter as per the screenshot above?

Thanks,

Bryan

Comments

  • Ray Deck
    Ray Deck Trusted Xano Expert ✭✭✭
    Options

    You can put the function stack to work! First get the record, then look at the result, and then make a decision based on what you saw using a conditional.

  • Bryan
    Bryan Member
    Options

    I'm assuming you mean do a


    1. Get a Record
    2. If-Conditional Statement
    3. If (Record.ID = exists), it does a Update Record and on that field I can set the conditional
    4. If (Record.ID doesn't exist), it uses a Add Record


    As you can see this is a fair few steps. Just wondering if this can all be done within the Add/Edit Record function itself. Is there something like a " .this " functionality or something?

  • Ray Deck
    Ray Deck Trusted Xano Expert ✭✭✭
    Options

    The trick is that edit record doesn't know about the prior state of that record. So if you want to use information about what it was to inform what you want it to be, you need to use a get before the edit.