Hello world. I just tried creating some buttons to change values incrementally. The value is also set to appear on the screen. However, when I use them, the value displayed on the screen doesn’t change while I’m on that page. Further, after I’ve used an incremental button, I can’t navigate backwards with the NavBar back button. Please advise. Thanks.
Could you post screenshots of your UI and interaction and (possible scripts here).
If you have linked a text element into props it should update if the state changes. I’ve used e.g. Firebase increment some time ago in chat demo and it worked nicely.
Sure thing. This is an admin app for a dorky vampire game where a character’s blood is a resource.
Clicking either the “+” or “V” button for either blood or prestige will increase the number value of the associated datum on the data sheet. However, it doesn’t change it on this screen, and it causes the back arrow on the nav bar to stop working or require a couple of clicks to move to the previous screen (not sure).
This is the interaction window:
It’s hard to say what’s the problem but my guess is that the connection between then screens and the data source. I did a quick test by setting a Data sheet as data source for screen and add increment/decrement interactions to buttons: https://neonto.cloud/preview/9xe8xzew
At least on my test it works and the Firebase data is reflected back to the UI instantly.
My best guess is that you fetch the likes value to UI from carried property which obviously does not change when the data in backend changes. If you want to see the instant updates in the “details view” then you have to use Data sheet as Data source for the Details screen. Basically you need to create new Data sheet which has a query or “document key data slot” in the document path which returns just the one single document.
Update: I did create a separate data sheet that only ever contains one character entry at a time. (Query: Characters/$slot(‘ds_ActiveChar’)) This query does bring in data to the Data Sheet. I changed the component that selects character entries to update the ds_ActiveChar Data Slot to the document_key for that character. I’ve confirmed that the data slot is updating with the document_key in the preview by creating a field linked to ds_ActiveChar, which does show the correct document_key. So, then, the character data are sitting in the data sheet, waiting to be used.
How, then, do I link text blocks to that one row in the queried data sheet? I’ve selected a value in the data sheet (in the below example, “NameFull” on the “SelectedCharacter” Data Sheet) on the Data tab of the text block.
You can see below that the document_key flows through, but the text blocks connected to the data sheet do not:
While I’m here, I see that the Firebase Increment plugin only asks for the name of the data field to be updated. Since I’ve created this separate data sheet with a query, we have two sheets with the same field names. How do I specify it’s the value in the SelectedCharacter I want updated? At present, the specified interaction icon doesn’t change the specified value. I also tried to enter into that field (below) this query, but it wasn’t working either: SelectedCharacter/63b8RqMoqv8B2lFWWEY2/AABlood
Selecting the props do not link elements into any data source; they are ”just” props. To connect data your screen must have the Data sheet set as it’s data source and then the props will be ”filled” from the sheet.
Other way is to pass props from previous screen but I’m guessing that you need to set the screen’s data source in this case.
The increment will detect the datasheet based on the context. If you are pulling screen’s data from a certain data sheet row then the increment will point to that sheet row.
Thanks! I think that should work, then. Cheers,