How to let users change the data in Firebase and the dynamic component list?

This is the extended question of my previous discussion.
How to get data from Firebase to create a dynamic component list with a Schema template?

Since the question is a new topic, so I created a new one (Hope I do not violate the rule).
I have read some references, which is also the extension…
[Free/OS] Dynamic Click Utils - An Extension to handle clicks on child components easily with dynamic components

My goals, as well as the questions, are:

  1. Let users click on the dynamic post for the application [Use Dynamic Click Utils?]
  2. A question will be popped up with a specific Post ID = “postid”. [Notifier?] *See below image1
  3. They can click on “Apply now” or “Later on” (“Later on” = cancel the action).
  4. If they click on “Apply now” , “playerno” will increase by 1, which changes the data in Firebase.
  5. If the “playerno” = “playertotal”, the post should be hidden.

Here is an example for goal 4 & 5:
4) If a user applies for the post (“postid”=000002), the “playerno.” increases by 1, which becomes 1/5.
5) If a user applies for the post (“postid”=000001), the post will be hidden as “playerno” = “playertotal”.

This image1 is the application action screen I want for goal 2:
It should appear after users click on a dynamic post with a corresponding "postid".
I hope it appears in the center and the background will be darker [light theme in the Notifier?]

The image2 is the flow of the application process (Blocks and UI images)
I try my best to use my knowledge to produce the blocks…
I believe many of them are wrong and missing.

Now, I have successfully created the dynamic component list with real-time data, and I made the UI for the application action. However, the application process is too overwhelming for me as it has many actions happening in a short time… I get lost :woman_kneeling:
Here is my aia: PostApplyTesting.aia (53.5 KB)

Could anyone help me to edit the blocks to achieve the above objectives? Thank you :pray:

PostApplyTesting(1).aia (55.5 KB)

Here i have used my firebase field details (pls ref my previous reply) so just replace your field names and pls test it whether it is working to the expected one or not… (Pls Remeber compare my field names with previous post)

1 Like

Thank you very much for your time and effort. :bowing_woman:
I can successfully click on different posts with the corresponding “postid” in the question!
Also, when I click the “Apply now” button, the post is invisible, which meets the logic.
However, I miss something in my previous application flow… Sorry

In the Post Screen (Import878268):
1) If the “playerno” = “playertotal” (“field9” = “field10”). Could this “NotificationFull” send to all the involved users all the time?
*As users can quit the game post at any time, this notification can send to them multiple times

In the “Events” Screen:
Suppose there are 3 users (A, B & C). They have signed up for an account in this app via their emails and set their usernames as A, B & C, respectively [Assume they have different usernames.]
They can create (& delete) and apply (& quit) game posts in this app.
For example:
A: A creates a post with “postid”=“000001”, and click “CREATED” to see the post in the “Events” Screen
B: B applies for A’s post and click “APPLIED” to see the post in the “Events” Screen.
2) Could their “Events” Screens look like this? [Use “username” (“field”) for the condition?]

Besides, if they click on the posts, these questions will pop up to ask them.

3) If A clicks the post in the ‘CREATED’ and the “Delete” button,

  • Could this game post disappear from everyone’s screen, including the “Posts” screen?
  • Could a “NotificationDelete”’ message send to all involved users (A & B)?

4) If B clicks the post in the ‘APPLIED’ and the “Quit” button,

  • Could “playerno” (“field9”) decrease by 1 in everyone’s screen, including the “Posts” screen?**
  • Could a “NotificationQuit”’ message send to user A if the post is originally full → “playerno” = “playertotal” (“field9” = “field10”)?

6) Could C see A’s post is 1/2 → “playerno” = “playertotal” (“field9” = “field10”)
when B applies for the post?
(I am nor sure whether it is solved?)

  • If C applies to A’s post and the post should be invisible in the “Posts” Screen.
  • It C quit the A’s post, the post should be visible in the “Posts” Screen again.

The is the overall flow I guess

I have added the " Events" Screen for the above goals and the “Signup” screen for multiple accounts to log in the app for testing.
Hopefully, I have finished all the needed UIs. (Spending hours and hours to make them :confounded:)

Could you please help me to solve the above problems? :pray:

:cry: :cry:

This much of queries …!!!

sorry man… If any error found let me check it…

It is fine, and this is my fault (There are too many blocks…)
I think we should solve them one by one first…Let’s go on goal 6 first
Recap:
6) Could C see A’s post is 1/2 → “playerno” = “playertotal” (“field9” = “field10”)
when B applies for the post?
(I am nor sure whether it is solved?)

  • If C applies to A’s post and the post should be invisible in the “Posts” Screen.
  • It C quit the A’s post, the post should be visible in the “Posts” Screen again.

I am trying to simplify the sign-up step that stores users’ name "username" to FirebaseDB and TinyDB to make the user becomes identical. Then, we can use the usernames to compare whether the user is the creator of the post to not. [Hope my logic is correct]

But I do not know why it overwrites the username, even if I use different devices…
→ It should be User1, User2, User3…

Username_data

Here are the sign-up blocks:

If this problem is solved, I hope I can test goal 6 to see whether different users view the post
I create these new blocks to push notifications if “playerno” = “playertotal” (“field9” = “field10”)
Here are the Import878268 blocks:

Here is my latest ver. aia:
PostApplyTesting2 .aia (75.2 KB)

Please help me solve these issues. Thank you :bowing_woman:

Based on your blocks the length of global user will always return 1, that’s why for every user sign-up the bucket returns user1 and overwrites the values

Use this logic…

If the tinydb (tag-username) doesnot have value 
Set bucket to Test/Allusers 
Get firebase taglist

When firebase taglist 
(Use one local or global variable to catch the result)
Set the global variable to length of the list get value


When sign-up clicked
Set tinydb to save the username
Set firebase save tag(user+above variable)
Value (the same logic)

Now it won’t overwrites but writes one by one

Try this and evening after finishing my professional work will look into try to solve the goal6

1 Like

I am sorry that I still cannot get the result, even if I try to follow your instructions (My understanding of blocks’ logic is too bad :woman_kneeling:).
I use 1 device with a companion, and another device is an Android emulator that downloaded the apk.
I do not know why they still replace the value… Maybe it fails to generate User2, User3…?

Usernameaaaaa in FireDBUsernamebbbbb in FireDB

My firebase URL is this in UI and empty in the Project bucket.
image

Could you tell me what blocks are wrong or missed?

On sign up pls use the firebase bucket as Test/Allusers/User+global variable

Like this?
But, it still replaces the username’s value :sob:

Even if I add +1. it generates the same result (only User1 exists)

When firebase got the list, printh the value into a label or variable and show us the result

Sorry, I do not quite understand your meaning…
Do you mean I need to change these blocks?
But how to ‘print’ them?
blocks (26)

Here is the aia :pray:
PostApplyTesting2.1.aia (75.5 KB)

Sorry for bothering you again. :pray:
Actually, I am trying to combine those blocks you help me before into the same screen.
I see the procesure ‘Reset’ stands alone(?) Could you tell me where should it links to? Thank you
PostApplyTesting(1).aia (55.5 KB)

In this screen i think it doesn’t need. Because you are not re creating the components. This reset procedure can be used whenever you call data again on button clicked or cv clicked

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.