In Power Pages (previously called “Power Apps Portal”) app, we observed recently that when we download and upload Portal configurations data from lower (Test) to higher (Production) level environment, Web Pages (Content Web Pages) where existing Custom Javascript was completely removed at the lower environment, was not propagating to higher level environment portal app.
After the upload configuration, we tried to purge the cache and configuration sync at the Production app, but it didn’t help. Also, CTRL+F5 was of no use.
After trying out various options, we just tried to put some empty lines in the Custom Javascript box (after deleting all existing JS code) in the lower environment app. The idea was to keep at least some empty/blank lines/values in the Custom Javascript box. And we then uploaded configurations again with the script (pac paportal upload).
And this time, it worked!
The problem is, if we keep the Custom Javascript box completely null (no empty lines/spaces), then it may be that the upload configuration script (pac paportal upload) ignores this metadata and doesn’t overwrite it at the existing higher level environment app.
Keeping some empty lines/spaces at the Custom Javascript box maybe then tells the script that it has changed values and then, during upload, propagates this empty change (even though empty lines) correctly to a higher level environment Power Pages app.
I hope it will help someone out there facing the same problem!
Happy Learning, Anywhere!