Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
luke_brady
Contributor III
Contributor III

Changes made with ApplyPatches() visible with getProperties() but not in the application

Hello all,

I've been messing around with enigma.js and wanted to try changing the title of a simple table.

I got the ID of the table and made sure not to set the boolean in ApplyPatches to true, meaning that the change should persist because it's not a soft patch. When looking at the properties of the table, I can see that the title I've chosen is there and I expected the title to also be visible when going into the app.

Am I missing something or does anyone know the reason why the title that I've passed with ApplyPatches and is now the title, according the engine, is not being shown? The path I used was "/title", which as far as I'm aware is the title that appears at the top of the visualisation when the hide title setting is not turned on.

Thanks for taking the time to read if you did and appreciate all replies!

 

Labels (4)
1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I use a session object as a working object and then copy it's properties to my target object (obj). Like this:

var sessionObject = await app.CreateGenericSessionObjectAsync(await obj.GetPropertiesAsync());
await sessionObject.ApplyPatchesAsync(patches);
var sessProps = await sessionObject.GetPropertiesAsync();
sessProps.Info.Id = "";
await obj.SetPropertiesAsync(sessProps);
await app.DestroyGenericSessionObjectAsync(sessionObject.Id);
await app.SaveObjectsAsync();

Yes, it is reflected immediately across all sessions. 

-Rob

View solution in original post

8 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I've run into that issue as well. My workaround is that after ApplyPatches(), I GetProperties followed by SetProperties. 

Not sure why this is necessary, but that's what I do.

-Rob

Øystein_Kolsrud
Employee
Employee

If you set the Boolean to "true", then that implies you are doing a soft patch which should not be persisted. So try setting it to "false" instead.

https://qlik.dev/apis/json-rpc/qix/genericobject/#applypatches

luke_brady
Contributor III
Contributor III
Author

Hi,

the boolean is already empty, which defaults to "false", so it's not a soft patch. Soft patches are also not shown in getProperties(), only in getLayout().

Øystein_Kolsrud
Employee
Employee

Ah, sorry... I missed the negation in your sentence there...

luke_brady
Contributor III
Contributor III
Author

I think I'll give it a try too.

What parameters are you passing with SetProperties()? 

Does this then change the title in real time that you can see it immediately in the app, in your experience?

Thanks!

gfuellerer
Contributor II
Contributor II

In my experience, "ApplyPatches" sometimes works immediately and sometimes it takes some time. If you duplicate the app, the duplicate usually reflects the desired changes. Seems like there is some "server side" caching of the app. It does not seem to be caused by client browser caching, because switching to incognito mode so far has never solved the issue for me.

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I use a session object as a working object and then copy it's properties to my target object (obj). Like this:

var sessionObject = await app.CreateGenericSessionObjectAsync(await obj.GetPropertiesAsync());
await sessionObject.ApplyPatchesAsync(patches);
var sessProps = await sessionObject.GetPropertiesAsync();
sessProps.Info.Id = "";
await obj.SetPropertiesAsync(sessProps);
await app.DestroyGenericSessionObjectAsync(sessionObject.Id);
await app.SaveObjectsAsync();

Yes, it is reflected immediately across all sessions. 

-Rob

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

The issue may be that ApplyPatches() doesn't trigger the object change notification as SetProperties does. 

-Rob