Hi All,
I have created a WebApp, and need to know the folderName and folderId details, where the WebApp exist.
As those details are available in the nms:webApp schema, along with other linked schema, I am trying to query them in JS acitivity of our WebApp.
I tried hardcoding the formName value to the webapp internal name. In all the cases the query returns blank. Not even empty XML is returned. Are there any restrictions on query with WebApp
var formName = this.internalName;
var query = xtk.queryDef.create(
<queryDef schema="nms:webApp" operation="select">
<select>
<node expr="[folder/@id]" alias="@folderId" />
<node expr="[folder/@name]" alias="@folderName" />
</select>
<where>
<condition expr={"@internamName ='"+formName+"'"} />
</where>
</queryDef>).ExecuteQuery();
logInfo(query)
Regards,
DG
Solved! Go to Solution.
Views
Replies
Total Likes
Regarding access rights, the user who is executing the query should have access to the "nms:webApp" schema and the folders where the web apps are stored.
In your case, it seems that your web apps are stored in the "Resources -> Online -> Web applications" folder. You should make sure that the user executing the query has at least read access to this folder and all its subfolders. You can check this by going to the "Security" tab in the "Administration" section and verifying the access rights for the user.
If the user does not have access to the folder where the web apps are stored, the query may not return any results or may only return results from a specific folder where the user has access.
Hello @dipendu_g
Make these three changes, and it will work.
Views
Replies
Total Likes
If it does not work after following those methods.
Then after making those changes. Try this
var myFolderId=""+query.@folderId+"";
logInfo(myFolderId);
Views
Replies
Total Likes
Hi @_Manoj_Kumar_ ,
Tried both the options that you suggested. Its still coming as blank.
Regards,
DG
Views
Replies
Total Likes
Hello @dipendu_g
I found another issue.
this.internalName will not return the internal name of the webapp. This is why the result of your query is always blank.
Views
Replies
Total Likes
Hi @_Manoj_Kumar_ ,
Its returning the internalname for me.
But additionally, I had tried the query by hardcoding the internalname(APP381) as well. Still the same issue.
I also tried using the query without any constraints, and it only returns results from folder nms:TechnicalWebApp
Additional ref - that I am on ACC v8.
Regards,
DG
Views
Replies
Total Likes
Yes, This seems to be a v8 specific issue. This code works on v7 instance.
Views
Replies
Total Likes
Hi @dipendu_g,
There are a few potential issues with your code that could be causing it to return a blank query result:
There could be other issues causing the query to return a blank result, such as incorrect syntax or missing values. You may want to try running the query in a separate environment, such as a query console, to see if there are any errors or issues that you need to address.
Views
Replies
Total Likes
Hi @akshaaga ,
Point No 1 - was typo when I wrote the code here. Its already corrected.
Point No 3 - As I said, I even tried hardcoded internal name as well.
When I dont give any restrictions ( Where clause ) I only get results from a particular folder nms:TechnicalWebApp
Point No 2 - Which user should have access to those folders ? If you can be more specific, I can check.
My WebApps are under Resources -> Online -> Web applications folder. When the published WebApp is run on a browser, it run correctly.
Regards,
DG
Views
Replies
Total Likes
Hello All,
We need to give the webApp Agent access to the Web Application folders ( Read Access ) and it worked !!!
Thanks @_Manoj_Kumar_ and @akshaaga for your quick support and pointers
Regards,
DG
Views
Replies
Total Likes
Regarding access rights, the user who is executing the query should have access to the "nms:webApp" schema and the folders where the web apps are stored.
In your case, it seems that your web apps are stored in the "Resources -> Online -> Web applications" folder. You should make sure that the user executing the query has at least read access to this folder and all its subfolders. You can check this by going to the "Security" tab in the "Administration" section and verifying the access rights for the user.
If the user does not have access to the folder where the web apps are stored, the query may not return any results or may only return results from a specific folder where the user has access.
Hi @akshaaga ,
Any documented way to get the internalName of the WebApp that is being executed within the JS Activity.
I am using this.internalName, is this the correct way ?
Regards,
DG
Views
Replies
Total Likes
Yes, using this.internalName should give you the internal name of the web app that is currently being executed within the JS Activity.
this.internalName is a built-in property of the WebApp object that refers to the internal name of the current web application.
So, using this.internalName is the correct way.