Docs or Videos to Help with Moving Along if Variable Does Not Yet Exist in Function Stack

Options
Checking if there's a way to see if you know that the variable does not exist because it has not come into not to existence yet and most of the ways that I know how to check for those is if there's like no value associated with a variable,  however,  I was looking through the #Xano  documentation and there was a reference to something called existence but that was only available in the add-ons of.

I have tried using many different varieties of ways, using the counting method, the get setter, null value, false values, but that's for array values to see if an array has value but or to see if a variable has values associated with it. 

How do you go about checking and say hey if this variable doesn't exist  yet in the function stack  that it's okay to move on because it will in the next iteration.  

One of the many reasons that I love about the #PRO program is that  has just opened up recently to Xano community is now I have the confidence, If I cannot figure it out by myself which is a way to learn I know that Ray is there a multiple times a week to help me understanding the why behind the solution. 

The regular office hours provided by the Xano leadership team are wonderful as well. 

  

Comments

  • Michael Udinski
    Michael Udinski Administrator

    ADMIN

    Options
     I would use a conditional statement you could either say IF var =/ null THEN do your logic with that variable... ELSE do your logic without that variable

    Or if you want to be more inclusive then null you could use the is_empty filter for things like empty strings, empty arrays, objects, etc
    [CleanShot 2022-07-13 at 15.50.00.png]
  • Inayet Hadi
    Inayet Hadi Member
    Options
      does this apply to variable that do not yet exist during the first few iterations ?

    I looked at the  is_empty filter and that checks for value not whether the variable itself exists, or am I not understanding it correctly?
    

     
  • Inayet Hadi
    Inayet Hadi Member
    Options
      is_empty filter worked with the Get filter, thank you!!
  • Inayet Hadi
    Inayet Hadi Member
    Options
    Hey , Thank you for you suggestions , it is updating the db with correct data type, I had it working where it would update the same row, right now it creates a new row, any docs/videos you can post that would help me get that working, thank you 🙂 
  • Ed Martin
    Ed Martin Member
    Options
     In your function stack, are you using the "add record", or "add or edit record"? 

    I'm up against the same challenge, missing variables in the JSON submitted to Xano's endpoint causing a 500 response on Xano side.  Came here to find a solution, or post up, and well there you go, you're asking the same question. 

    Will try the suggestions from Michael and your efforts to see what I can accomplish. 
  • Ed Martin
    Ed Martin Member
    Options
     is what your screen shot shows, applicable in this example...?
    I have about 50 fields, of which not all will contain data (empty/null) in the form submission. 
    An example is a mailing address being different than the primary address entered.  In that case, how would one manage many empty values where this is not an alternate address?

    500 Internal Server Error
    Request Details
     Output
    message: 
    Unable to locate input: request.data.planAdminAltNameFirst
    [Null Values casues 500 error.png]
  • Inayet Hadi
    Inayet Hadi Member
    Options
      I was using 'add record' but going to to transition to 'add or edit record' so I am not recreating new rows. 
  • Inayet Hadi
    Inayet Hadi Member
    Options
     did you hear about the PRO group that   is offering? He has helped move so fast overcoming so many challenges, and thinking of solutions. One of the principal that I think will solve your solution is called 'dont hit the wall' which is create a variable above where you want to drill down, and then use the GET filter to see if it is there, if not then you can continue with your function without breaking it down.
  • Inayet Hadi
    Inayet Hadi Member
    Options
     I see what you did that is not working, after the GET you want to include what comes after the value 
    [image.png][image.png]
  • Inayet Hadi
    Inayet Hadi Member
    Options
      that is another awesome lesson that   helped me understand, I remember it  by 'don't hit the wall' and slow down 
  • Inayet Hadi
    Inayet Hadi Member
    Options
     how is going, by looking at the pictures you shared I am almost certain positive that you use the 'don't hit the wall' and slow method that will solve your issue. 
  • Ed Martin
    Ed Martin Member
    Options
     I was able to get most of it working, as described here.  There is one section of data that I needed to wrangle a bit differently.  I'm not entirely sure if/why/how that happened.  I'll need to get back to that function and check my work again, but overall, the majority of values with make + null worked great.