How can I apply a condition to function in a stack?

Options
dsturnerville
dsturnerville Member
edited June 2023 in ? Help! I'm a Noob

I am pulling properties from MLS and adding to a table using Upsert.

I have a custom function that pulls comps based on the address. I have that function run as part of a stack that pulls the properties from MLS.

I only want the custom function that pulls comps to run when a new record is added to the properties table but not when the record is updated.

I am using the output of the "Add or Edit Record In" function to provide the ID to my custom function so I can associate the comp to the property. How can the custom function tell if the record is new or just updated?

Tagged:

Answers

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

    Instead of using "add or edit", do a "has record" call on the table to see if a matching record is there. If it is there, run "edit". If not, use "add". That way you have the information in the stack on which path you followed to make intelligent decisions about what to do next.

  • dsturnerville
    Options

    This worked. Thanks.