Hello everyone, I’ll try to explain as good as I can, if you need other informations just let me know.
I’m creating an app where users can create activities and apply to other’s activities. I’m creating a screen where the user can see a list of the applications he sent and when clicking it should redirect himself to the activity details screen (that is the same as if the user clicks on an activity on the activity list wich is in the home page). However when I use the link action it only let me send “current application” data and not the activity data related to the specific application, so the activity details screen displays nothing.
I’ve searched everywhere to find a solution, from this forum to watching all Patrick Ford’s most common mistakes videos but I did not find an answer. Please help me.
Hi @Giosky,
This behaviour is expected - there is no place from where you can get “Current Activity”.
If you have M:1 relationship (one activity can have many applications, and each application belongs only to one activity), then you can easily get the activity details via Current Aplication → Activity → Property A(B,C,…).
So in the Activity details screen you show the details via this relationship.
Keep in mind though that you can’t reuse similar “view activity” screen from other app part (if you have list of activities → view activity and you’re using current activity there). So these 2 screens should be different.
If you would absolutely like to reuse the existing screen, then you can create a single-item list of activities, filter it by activity ID is equal to current application → activity → ID, and use an element in this list to link to activity details screen. With this you’ll get current activity. Single-item lists have been discussed on the forum quite a lot of times.
Hope this helps.
Best,
Victor
Hi @Victor,
Thank you very much for your help. It’s sad that Adalo doesn’t support this kind of things.
There’s only one thing not very clear to me. When you talk about the single-item list where should it be placed? in the applications screen? then if it’s a single-item list the other applications won’t be displayed.
@Giosky let’s imagine you have the following screen structure:
Home → A1 List of Activities → A2 View Activity
Home → B1 List of Applications → B2 View Application → B3 View Activity of the Application.
As I’ve mentioned before, there is no Current Activity on B3 as there is no place from where you can get it. But you can get Activity info via the relationship. So, A2 and B3 can’t be the same screen.
If you’d like to combine A2 and B3, you need to somehow have Current Activity on B2 (so that you pass Current Activity to A2).
The only way to get the current X record is a list, therefore you need to have a list of activities in B2. But of course you don’t need all activities, you need just one which is actually a “parent” activity of the Current Application in B2. This is why we’re talking about a “single item list” here. One of the ways to create it is:
- add a button on B2
- add an action on this button, a link to A2
- convert this button to a list
- make it a list of activities
- filter this list so that only one activity is displayed (which ID is equal to the ID of the Current Application → Activity).
As a result you will have a button which will transfer the data to the target screen.
Best,
Victor.
Thank you @Victor! That is exactly what I was looking for. You saved my brain from boiling and I’m sure this thread would be helpful for other users.