I have a formula in a button, and when I paste it into another button one of the variables changes. I cannot find a way to reproduce the working code. pasting it or by typing. If i am in the working code and i backspace the variable and then tab it again, it changes. How can i force coda’s smart coder to take the same variable that I have that is working?
here are the 2 screenshots, the one that says it is outputting a list of rows is code that is not working, and the one that says it outputs a row is the working one. I cannot seem to reproduce that same variable anywhere. Even if i copy it. It pastes as the list of rows.
Hello @Nik_Martin ,
Looking at these two screenprints I find it impossible to help you. Please share a sample doc so we can see what is going on.
You are talking about the changing variable - but what is the variable?
Greetings,
Joost
@Nik_Martin
is the columns you are referencing and pasting to all the same in terms of multiple selections?
cheers!
Mel
Hey! Thank you for the response. Hopefully I can better explain my issue.
This is the same code, but when trying to paste the code into another button, the button breaks. This is showing the issues im having with the [CFT Inspection Data].[Inspection item] part. The key is to look at the sub text, one says its outputs a row and the other says it outputs a list of rows. I cannot reproduce the variable that says “out puts a row” which is in its working state.
I have built a rather complex “program” in a coda doc that utilizes 238 Buttons and Controls and 279 Formulas, as well as 112 tables, some of these tables are cross doc so its really hard for me to try to give you a sample doc because all of these connections need to be there for the function im having a problem with to even run. I will add in a doc with the code in both buttons, but these will not be able to run, but will hopefully give you somewhat of an idea. I will also try to simplify the code and remove some of the unneed lines. I think the button is around 359 lines of code, but have found that is issue is with one variable in particular.
This problem is in my LOAD button which takes inspection data that i have in my database, and loads it into this Tool ive created on coda. This button is taking data from a cross doc table which is called “CFT Inspection Data”, converting the structure, and loading it into a table called “CFT MAIN” the issue is with the data is not loading into one column in particular and thats [CFT MAIN].[Butt Item] from [CFT Inspection Data].[Inspection item]
Additional context on the 2 screenshots i previously provided:
-The variable: [Inspection item] → this is the working one
CFT Inspection Data].[Inspection item] → this is the not working one
Keep in mind that these look different because that is how they paste, in the coda “smart” formula they both look like [CFT Inspection Data].[Inspection item]
-These are screenshots of the variable that I am not able to reproduce, one is the one that is “stuck” in the working state, and the other is the result when i try to recode it, either manually or by copy and paste. it does not go into the working “stuck state”. They look almost identical, but when you look at the sub text when the variable is highlighted, you can see the difference (so you can also see the slight difference in the symbol to the right of the variables text)
This was one of my previous suspicions, but i have since tested with this “Allow multiple selections” on and off. Regardless of that toggles state, the button works with that variable in its un-reproducible state, and when i copy and paste the code (and that variable changes states after the paste) it does not work
Also please see the additional info i provided on a reply to the other response in this thread.
Thank you!
Can you take a snapshot of the two different outputs you are getting?
From what I can see in your two screenshots, you are filtering “CFT Inspection Data” and then running a ForEach on the filtered set. It then appears later in the forumla you are wanting to reference the current record in the ForEach of the “CFT Inspection Data” filtered data set? If that is correct, you need to use CurrentValue -
That will reference the current row being worked on in the ForEach.
Regards,
Robin