I have a Chores Details screen and would like to add a button that can be clicked to set the Status to Complete.
I've tried Overwrite and Update Automatons but struggling to figure out how to reference the Context Row. Or if I can't do that is there an easy way to uniquely identify the row and update it without filtering by every single column? Usually I would use and Identity Column in an update statement.
The Quick Complete button is shown here.
That button needs to change this column value (in context) to Complete.
The following just updates the Status column of the first row of the Chores table instead of the data currently shown in the details screen.
I have also tried to reference THISROW() and $INPUTROW but just received errors. What is the best way to accomplish what I'm trying to do? Thanks for your help!
Try this formula instead:
=findrow(chorestatus, “chorestatus[status]=%”, “complete”)
Are you referring to the "Take data from:" field. That part seems to be working fine. Unfortunately it just doesn't write to the correct row in the Chores table. It writes to the first one only. Which is different from the one that is displayed on the screen (the one in context).
I can try to parameterize it like you suggest in case I'm misunderstanding though. Thanks!
Please replace the =Chores[Status] in the write field to just =[Status]. By prefixing the table name, honeycode will try to guess which row to update since it represents the full column whereas =[Status] will use the context of the current row being updated.
Please let me know if you continue experiencing issues.
Thank you for the suggestion. I forgot to mention that I had tried that already as well because I was sure that would work. But I just tried it again.
When I run the app here is the error message I receive after clicking the Quick Complete Button.
Hi @AndrewB -- I have seen the % used in the findrow syntax several times but am unsure what it is for. Can you explain?
Hi @TigerTriangle - I am fairly new to Honeycode, but have used a button to do something similar about a dozen times in my apps so I thought I would give my two cents.
I use the Overwrite Automation to accomplish this.
For your scenario, I would do the following:
Take Data from: ="Complete"
and write to: =FINDROW(Chores, "$[Variable on screen that identifies chore to update] = Chores[that same identifier]")[Status]
For example - if each chore has a unique identifier like a name or a chore #, then you can use that to reference which line needs to be updated. If you are using a column list with a detail page, you should be able to click through to the detail page, and it will use the first column of the table it is referencing as the unique identifier to create a variable on the page (I'm unsure of how to change which row it uses). From there, you reference that variable in the FINDROW function to lookup that row in the Chores table.
Not sure if everything I wrote was clear, but I hope that helps.
It’s like a variable. You can use them within filter and findrow expressions, within the quotation marks, and then define what they stand for in the next arguments.
=filter(table, “table[a]=% AND table[b]=%”, “1”, “2”)
Will find rows with a 1 in column A and a 2 in column B.
Thanks for responding @Jared,
Currently there is no unique ID column in my Chores table. I was going to add one a few days ago but when I started searching these forums people were saying that Identity Columns are not needed because RowLinks and Filters can be used instead. So I thought I might be just bringing my MS SQL habits to HoneyCode. But at this point I think you are correct. It might be time to just go ahead and add something where I can reference the correct row (until someone tells me there's a better way).
Hi @TigerTriangle -- you're welcome! I have seen the what has been written about RowLinks and Filters, but I am still not 100% sure on how to use them effectively, either. Best of luck to you!
@TigerTriangle yes, you do sometimes need uids. You just don’t need them as often as you do in Sql.
@TigerTriangle If I understand correctly, the "Quick Complete" button is on the Chores Detail screen which displays a particular chore.
Is the "Quick Complete" button inside the block that is displaying data from row? I am assuming not, since the
=[Status] did not work.
You can modify the expression to
=$[InputRow][Status] where InputRow is the variable that stores the row being displayed on the screen. You may have used a different name. Please let us know if you continue to face issues.
@Sid - Sorry for the delay. I will definitely try that when I get a chance and let you know.
@Sid after changing it to =$[InputRow][Status] it worked (also works inside the data block). Thanks! I just didn't have the [Square Brackets] around InputRow when I originally tried it so that was the missing piece of the puzzle. I also tried =[Status] when the button was inside the block that was displaying the data from the row and it worked as well (but does not work outside the data block).
Strangely enough however, they both show warnings when viewed in the Builder. Seems like a bug. I would love someone from the HoneyCode Team (@aj, @Taylor) to verify. See below...
Inside the Data Block
Outside the Data Block
Using FINDROW so it inserts a RowLink...
I've had warnings, too, on formulas that were working fine for me. If it bothers you, sometimes I've found they will go away if I specify an initial value for any variables in the sheet, especially an $[InputRow] variable if you have one. In this case, I would try using =FINDROW(Chores) as the initial value of your $[InputRow]. Honeycode seems to use the initial value to do some error checking for you. It will also use the initial value to populate variables in the app builder as sample values as you design your app.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.