Pass values to reuseable element?

Hi,

want to establish a job counter in the header menu.
Something like

  • Number of open Jobs
  • Number of jobs in the users wishlist
  • Number of users applications

I’m able to publish the values on page load.
Use the trigger page load and put the selected data in custom states.

What is the best way to update the custom states in this case?
Thought about custom events. Is this the right way to go?

Thanks
Gerald

I don’t think custom states is the way to go for this scenario. I’d recommend you save the “whishlisted jobs” in the user data type and display the data accordingly.

Thanks for your response.

Yes, I can use the way using the data type to transfer the information and set up two custom types in the page itself and in the header (reusable element).

But what I miss or don’t understand yet is the “missing trigger” that informs the header to get the changed (new) information from the data type.

Any ideas?

Aaah I see. It should update automatically when you get changes on your DB. If not you can use the action “Display data in group” to change it’s value using the result from the previous step (where you updated your DB). Element clicked → Make changes to… → Display Data in group.

Make sure the group you’ want to display the data on is of the same type you want to pass along to avoid any errors.

Yes, I want to update the header values automatically based on the changes on the page.

And I really don’t know how to handle changes between pages or a page and a reusable element like the header.

A trigger or some kind of observer.

I suggest dont use page load triger it use compute power and make you page load slower.

there are many wasy , you can use hidden group which are referencign the jobs and applicaiton and then you reference the group to respected place.

Or what i suggect, inside you user hvae a filed for each wishlist job whcih should be a list of job, so you can use count to see how many job this user have applied. and in side job have a field for applied which would be a list of user so you know how many user applied

just reference these point in your reuseable element that set, it will auto update

1 Like

Thanks, that sound interesting.

How to create a reference?

Only used custome states and Do a search for … up to now.

Thanks

Thanks!
It was as simple as that.

Used the parent group and did a “Search for JobWishlist:each item’s JobList:count” and used this parent group in the text element “Parent group’s number: formatted …”

Now it’s updating automatically.

Quite basic!

Thanks for the hint!

1 Like

yes. that simple, and also one thing we do a lot is , we create a hidden popup and inside it groups to use them as data container, and then we reference then in app many places.

if you ever get stuck ping me here or in linkedin , always happy to help.