Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Reuseable Action Code

I have 6 actions that need to be performed when a user clicks an object.  I have 12 of these objects. Is there a way to write a function/routine/code block (I don't know what to call it) where I can place all 6 of these actions and then on each clickable oject just call this function/routine/code block to perform the actions?

1 Solution

Accepted Solutions
alexandros17
Partner - Champion III
Partner - Champion III

Place actions in the object itself than copy and past the object ...

View solution in original post

5 Replies
alexandros17
Partner - Champion III
Partner - Champion III

Place actions in the object itself than copy and past the object ...

Not applicable
Author

So if one of the actions needs to change I have to change 12 different objects.  That is what I should not have to do.  I want to be able to change the "action" one time in one place and all 12 clickable objects then would be correct. 

vishsaggi
Champion III
Champion III

I have not tried but try to paste the sheet object as link. When you copy the object and right click you get

paste sheet object

paste sheet object as link  <-- Try that and see

alexandros17
Partner - Champion III
Partner - Champion III

unfortunately You cannot define "Actions" outside objects, you could use macros but this is not a good choose.

However, if the 12 objects are all different (if it was possible to write all the actions in only a place) you have to write 12 different sequences of actions.

Not applicable
Author

Building off Alessandro's suggestion, you should create the first object that has all of the actions and then rather than just copying and pasting, you should Copy and then right click --> Paste Sheet Object as Link.The two objects will then be linked together so a change in the action of one will impact the others (same holds true with general formatting as well).