JavaScript API

Zack Wilson shared this question 18 months ago
Completed

Do you have any documentation regarding the restrictions on the JavaScript API? Smith Brothers of Berne are willing to implement the JS API, but it seems like there is a restriction on calendar/date filters and on drill-down functions.

Replies (55)

photo
1

Hello Zack,

Thanks for reaching out to Yellowfin support.

Please refer to the documentation provided below for information regarding the limitations on the JavaScript API.
https://wiki.yellowfinbi.com/pages/viewpage.action?pageId=37061306#JavaScriptAPIv2(legacy)-Limitations

Please let us know if you have any questions or concerns; we would be more than happy to assist you.

Regards,
Sharwari Inkane

photo
1

Hey Sharwari,

your link is pointing back at this topic page... (https://community.yellowfinbi.com/topic/27768-javascript-api). I just copied and pasted, but if anyone else stumbles along, it might be good to fix.


Also, that is the main question I have... Is there ways around it? is it strictly the calendar widget? Can you feed it dates externally and use our own widget...?

What about 9.2, JavaScript API v3?


Thanks,

Zack

photo
1

Hello Zack,

I apologize for the inconvenience caused. Here is the correct link: https://wiki.yellowfinbi.com/pages/viewpage.action?pageId=37061306

Regarding your questions, I'll check with our wider team and get back to you with an update.
Thank you!

Regards,
Sharwari Inkane

photo
1

Hello Zack,

Apologies for the delayed response. Regarding the "Drill anywhere" functionality, I have found a relevant Jira ticket (YFN-18626). It appears that Drill Anywhere functionality is enabled for reports that are loaded using the JS API V3 in version 9.2. Regarding your other questions, I have raised a Jira task with our wider team. Once I receive a response from them, I will provide you with an update. I have also shared Jira id with this ticket for your reference.
Thanks!

Regards,
Sharwari Inkane

photo
1

Sharwari,

Thank you for getting back to me! That is great news! I will await your further findings.


Thanks again,

Zack

photo
1

Sharwari,

Is there a reason you are "Awaiting Reply"? I just wanted to make sure.


Thanks,

Zack

photo
1

Hello Zack,

Apologies for the inconvenience. The ticket was mistakenly converted into 'Awaiting reply'. Rest assured, I am actively looking into your ticket and will provide an update once I receive a response from the development team.
Thanks!

Regards,
Sharwari Inkane

photo
1

Hello Zack,

Regarding the drill anywhere functionality, could you please try using the code provided below:

Testing Steps:

1. Add an entry into the configuration table of your db:
INSERT INTO configuration VALUES(1, 'System','CORS_ALLOWED_ORIGINS','localhost:8082,localhost:8081');

2. Write a script similar to the one below, and place it in \appserver\webapps\ROOT of your instance:
Note: Replace the path to your instance up until /JsAPI. You may also use a report with drill anywhere enabled by using reportUUID instead.

<!DOCTYPE html> <script type="text/javascript" src="http://localhost:8080/JsAPI/v3?dashUUID=b5ded174-c72a-40a4-bb81-06709f5d5a16"></script>
To access you script, add the name of the file to the end of the url you use to access your instance (eg. *http://localhost:8080/my_file.html*).

Once your dashboard or report with drill anywhere has loaded, you should be able to drill as you would through the app.

Could you please give it a try and let us know if you encounter any issues? If you have any questions or concerns, please let us know. We are here to help.

Regards,
Sharwari Inkane

photo
1

Sharwari,

I will tackle this as soon as our main web developer is back from vacation. In the meantime, have you heard anything on the calendar selection issue?


Thanks,

Zack

photo
1

Hello Zack,

Thank you for your update. Unfortunately, I haven't received any information regarding the calendar selection issue from the development team yet. As soon as I receive a response from them, I will provide you with an update.
Thanks!

Regards,
Sharwari Inkane

photo
1

Hello Zack,

I hope you're doing well. I just wanted to follow up on our previous conversation about the drill anywhere functionality. It has been 6 days since our last communication, and I wanted to inquire whether your main developer has returned from vacation and had an opportunity to test the steps I provided.

I would appreciate an update on the progress or any feedback you might have. Please feel free to reach out if there's anything else I can assist you with. I'm here to help.

Looking forward to hearing from you soon.

Regards,
Sharwari Inkane

photo
1

Hello Zack,

I hope you are doing well.

I just want to touch base to see if you had a chance to read through my response. If you can let me know that would be great.

Regards,
Sharwari Inkane

photo
1

Sharwari Inkane,


I am still waiting for our main web developer to get back... He is supposed to return this week. I will get back with you asap.


Thanks,

Zack

photo
1

Hello Zack,

Thanks for the response. I will be waiting for the updates. Please let me know as soon as you have any further information. Thank you!

Regards,
Sharwari Inkane

photo
1

Sharwari,

We are getting this error: TEXT on page, "You have tried to perform an action on a page that has already been processed."

Also this error in the console: "Uncaught (in promise)


  1. Array(1)
  2. : {key: 'error.transaction.token', description: 'You have tried to perform an action on a page that has already been processed.'}
  3. length: 1
  4. [[Prototype]]: Array(0)


Thanks,

Zack

photo
1

Hello Zack,

Thanks for your reply. I wanted to let you know that I have informed the wider team about the issue you are facing. I will keep you updated as soon as I hear back from them.

Thanks!

Regards,
Sharwari Inkane

photo
1

Hello Zack,

I hope you are doing well.

I wanted to inform you that I have received below update from the development team.

Regarding the error you mentioned - This message is produced for an invalid token. There is a verification if the token in the request is the same as the session. Cacheable actions usually bypass this verification(protection), so it is a good idea for them to check if any of the resources served for the Drill Anywhere are cacheable.

Additionally, the development team is aware of an issue related to Drill through to Dashboards, and they are working on it. The fix for this issue is scheduled to be addressed in the upcoming release 9.10.

Regarding the restrictions on calendar/date filters, I would appreciate it if you could provide some more context or a test case. This will help development team to verify if the functionality is being used correctly or confirm if there is indeed an issue.

If you have any questions or concerns, please let me know.

Regards,
Sharwari Inkane

photo
1

Hello Zack,

I hope all is well,

I just want to touch base to see if you had a chance to read through my response. If you can let me know that would be great.

Regards,
Sharwari Inkane

photo
1

Sharwari,

I checked and none of the resources for the Drill Anywhere are cacheable. I also tried to use other reports and dashboards that did not have a drill anywhere. I could not get it to work.


As far as the Calendar/Date Filters... According to the "restrictions" from earlier versions of the JS API (v2), it said the calendar selector for date filters is not available (see below).

62b5c5e0be780c2dc91191217c2d8a93


My question is, does this mean the calendar widget will not work? (again, see below)

432ffc8ef5d76a5780dc9e2376d031ae


IF that is the case and it does NOT work, is there the ability to supply dates from an external JS calendar widget/plugin (ex. https://www.jqueryscript.net/blog/best-event-calendar-plugins.html) and use it to filter results to the JS API?


Thanks,

Zack

photo
1

Hello Zack,

Thanks for your response. I have shared your response with the product team and will keep you posted once I hear back from them.

Regards,
Sharwari Inkane

photo
1

Sharwari,

I was able to get a dashboard to load after I put the file on my production server (/ROOT) and changed the path to the prod server. The dashboard with the drill anywhere loaded but did not work. I tried to load a report with a drill anywhere and the canvas portion loaded, but not the table.

32e0a6c7f8eda3b8e86cc0a609656fc5


Thanks,

Zack

photo
1

Also, The calendar widget DID work!

photo
photo
2

Hello Zack,

Thanks for your response. I am glad to hear that the calendar widget worked! As for the drill anywhere issue, I have informed the product team about it. I will keep you updated once I receive a response from them.

Regards,
Sharwari Inkane

photo
1

Hello Zack,

I have received some updates from the product team regarding the issue. They suggest that the problem might be related to Cross origin Resource sharing (CORS) not being enabled. They recommend reviewing the "Enabling CORS" section in the documentation and giving it another attempt.

Additionally, if the issue persists, could you please share a short screen recording regarding the dashboard and the report issues.

If you have any questions or concerns, please let me know.

Regards,
Sharwari Inkane

photo
1

Sharwari,

Is this pertaining to the Drill Anywhere Report? Either way, I don't know what else I can "allow" in the CORS... Also, if it were that, wouldn't it stop other things from coming through? As in I shouldn't be able to access other reports...


Thanks,
Zack


Thanks,

Zack

photo
1

I am able to see the data once it is exported (from the JS API html page), But, it doesn't show up on the html page itself

photo
1

Hello Zack,

Thanks for your prompt response. I have informed the same to the product team. I will keep you updated once I receive a response from them.

Regards,
Sharwari Inkane

photo
1

Hello Zack,

I hope you are doing well.

I wanted to share an update from the product team regarding the issue. They mentioned that a CORS error is being displayed in the browser's console. You can easily check if this is an issue when you checks the browser's console on not loaded content. The team believes that this could be the problem since there was an improvement when the dashboard has been moved to the server of the application you are integrating the JS API on - this practically makes them "same origin".

As for the Drill Anywhere report - could be a problem with the field hierarchy. There is a "Drill" section in the Report API's documentation where this is explained.

Unfortunately, the team is unable to troubleshoot with the provided information("I tried to load a report with a drill anywhere and the canvas portion loaded, but not the table.") - to debug this they would need this report and some replication recording on how you create it and the way you try to access it - They know it is a complication since you are integrating the API on your own application, but they can not help without knowing what you are doing.

On a positive note, during recent tests, the team successfully displayed a report on an external HTML page through the JS API.

Please let me know if you have any questions or concerns. I would be happy to assist.

Regards,
Sharwari Inkane

photo
1

Hello Zack,

I hope all is well,

I just want to touch base to see if you had a chance to read through my response. If you can let me know that would be great.

Regards,
Sharwari Inkane

photo
1

Hello Zack,

Greetings for the Day.

This is a follow up reminder that 2 days have passed without any activity in this ticket. When there's no activity, it usually means either that you have identified the solution for the reported issue or that the matter is no longer relevant and after 5 days (2 days from now) without any activity, we assume that the ticket can be closed.

If this is not the case, please do reply and let us know how we can be of further assistance, we would be happy to assist.

Regards
Sharwari Inkane

photo
1

Sharwari,

I need a few days to go through this. I have not had time this week. I should be able to get to it before Wednesday next week.


Thanks,

Zack

photo
1

Hello Zack,

Thanks for the update. I look forward to hearing back from you soon. Please let us know if you have any further questions or concerns. Have a great day!

Regards,
Sharwari Inkane

photo
1

Hello Zack,

I hope all is well. I wanted to follow up and check if you have had the opportunity to review the response. If you have had a chance to go through it, kindly let me know.

Regards,
Sharwari Inkane

photo
1

Hello Zack,

I hope all is well,

I just want to touch base to see if you had a chance to read through my response. If you can let me know that would be great.

Regards,
Sharwari Inkane

photo
1

Sharwari,


Right now, I am getting the attached error on from the console. I took a look at the documentation above, but I am not able to test it beyond the MyTestFile.

Thanks,

Zack

photo
1

Hello Zack,

Thank you for your response. Could you kindly provide this report and some replication recordings on how you created it and the steps you took to access it? This information would greatly assist our development team in their debugging process.

Regards,
Sharwari Inkane

photo
photo
1

Sharwari,

Let me be a little more specific, I was in a hurry yesterday and I ran into that error...

I haven't been able to work in detail with our web developer this week, because he is on a critical project. I should be able to bounce a couple things off him again this next week. However, I have been able to do this testing on several types of reports.

I was able to get a normal report to show on "MyTestFile.html". I was a little confused about the documentation regarding how the "field hierarchy" would stop the report from running or being able to access this feature. It is showing breadcrumb (field hierarchy) in the design mode.

b0b498c00202288f7c3641fae486b4d3


Regarding, troubleshooting the issue with it not displaying the table... I do not have the Ski data in our Prod environment, but I took a simple view with a field marked with the drill-anywhere option as a field permission. If I am doing something wrong for Drill Anywhere, I am not sure what I am doing.

6d9a0bc504ffd85b16f432a65fb51eea


For the error, I was using a dashboard that had the report mentioned above on it.


After further testing, I did find that the report above (with the drill anywhere) will work, but only if I change and show ONLY the table (see below). Otherwise it will not show the table, when the "canvas" is shown.

4964af94f0cdb556574d01d648dfeb66


So, I don't know if this is a win or not. :|


Thanks,

Zack

photo
1

Hello Zack,

Thanks for your response. I have shared your response with the product team and will keep you posted once I hear back from them.

Regards,
Sharwari Inkane

photo
1

Hello Zack,

There's an update from the product team regarding the functionality. When you press the chart icon, you can see the canvas (Chart view), and you can toggle the table view using the table icon. This applies to embedding a report.

The product team suggests embedding a dashboard containing both a chart and a table. This way, you can have both the canvas and table on a single page. Also, could you please update me on whether you've resolved the error from the logs file that you shared? If you're still facing issues, kindly share replication steps (a video recording would be greatly appreciated) and information about your setup. Please feel free to ask if you have any questions or concerns.

Regards,
Sharwari Inkane

photo
1

Hello Zack,

I hope all is well,

I just want to touch base to see if you had a chance to read through my response. If you can let me know that would be great.

Regards,
Sharwari Inkane

photo
1

Hello Zack,

Greetings for the Day.

This is a follow up reminder that 2 days have passed without any activity in this ticket. When there's no activity, it usually means either that you have identified the solution for the reported issue or that the matter is no longer relevant and after 5 days (2 days from now) without any activity, we assume that the ticket can be closed.

If this is not the case, please do reply and let us know how we can be of further assistance, we would be happy to assist.

Regards
Sharwari Inkane

photo
1

Sharwari,

I changed the report to the dashboard. However, the drill anywhere appears on a completely different area of the screen. I almost didn't see it at all.

FYI, I wrote a quick script to capture the location of the mouseclick on the screen (to help show how far off). This is also being done at a zoom of 100%

1st Click:b62aec758d046b89735294a2b93afc3f


Drill Anywhere Result:

87346eaa4137cd28b176c50b30e63d4c


MyTestFile.html

63e2a5c09f32a8826f724733b5e5ff4d


My "script.js" file

0defd94f75d81da225c58a841b9ac156


Thanks,

Zack

photo
1

Hello Zack,

Thanks for sharing the information. I will update you once I received any response from product team.

Regards,
Sharwari Inkane

photo
1

Hello Zack,

The product team requires more information to assist you effectively. To understand if there is a problem here, they need the dashboard you are using, replication steps with a screen recording, including the creation of reports & dashboards and the way you are embedding it. The "drill anywhere appearing" position could be affected by a lot of factors.

Also, could you please update me on whether you've resolved the error from the logs file that you shared earlier?

Please feel free to ask if you have any questions or concerns.

Regards,
Sharwari Inkane

photo
1

Sharwari,

I did a screen recording based on the Admin Audit View.... I am not sure how to get the dashboard to you, but the screen recording I sent over FTP. It is labeled "SB screen recording Sep 5, 2023 7_29 AM". Let me know if that helps.


Also, the error seems to have went away.


Thanks,

Zack

photo
1

Hello Zack,

Thank you for sharing the screen recording. Your cooperation is greatly appreciated. I have forwarded the recording to the product team, and I will reach out to you as soon as I have any updates from them.

Regards
Sharwari Inkane

photo
1

Hello Zack,

I have received a response from the product team. They investigated the drill pop-up position issue on the master branch and couldn't replicate it. If there was an issue, it might have already been fixed. They proposed a workaround using CSS. The popup element has the #drillAnywherePopUp ID, and its position can be easily adjusted in various ways when you update your version. Please review the screen recording for insights on the workaround.

Please let me know if you have any questions or concerns.

Regards,
Sharwari Inkane

photo
1

Hello Zack,

I hope all is well,

I just want to touch base to see if you had a chance to read through my response. If you can let me know that would be great.

Regards,
Sharwari Inkane

photo
1

Sharwari,

I noticed in the screen recording, it zoomed out. What was the purpose of zooming out? The whole issue is when it is zoomed in. If I zoom out to 50%, it will work normally. But, that is not acceptable. I would expect it to work no matter what my screen size/zoom is.


Thanks,

Zack

photo
1

Hello Zack,

Thanks for your response. I have shared your message with the product team. I will keep you posted once I receive a response from them. If you have any questions or concerns in the meantime, please let me know.

Regards,
Sharwari Inkane

photo
1

Hello Zack,

I hope you are doing well.

Based on the suggestions being passed to us, I see that we have some updates from our development team. The development team is using a small application specifically designed for developing the JS API. They are using it for authentication and other purposes and it has multi-window view and because of that they are unable to scroll down the big-sized dashboard which they created for this ticket. Zooming in or out is not related to the pop-up position.

To demonstrate this, they conducted a new test and recorded their screen. In this test, they embedded the same dashboard into an external HTML file, and there was no zooming involved. The drill-anywhere pop-up position worked as expected. They also tested various zoom percentages (50%, 80%, 150%, 180%, 200%, and 220%), and in all cases, the pop-up position remained as it should.

Our recommendation is to update to the latest version of Yellowfin, version 9.9, as there's a possibility that the issue you're experiencing has already been resolved in this release. However, if updating Yellowfin isn't feasible for you and since the product team can't replicate the 'drill anywhere pop-up position' issue, the best workaround suggestion is to use the '#drillAnywherePopUp' ID and adjust the element's position with CSS. A small function that retrieves the position of the drill-anywhere click(the <a> tag which activates the drill anywhere has) and then setting these to the #drillAnywherePopUp element should do the trick. We understand that this may be inconvenient for you, but it's currently the best solution we can offer.

Regards,
Sharwari Inkane

photo
1

Hello Zack,

I hope all is well,

I just want to touch base to see if you had a chance to read through my response. If you can let me know that would be great.

Regards,
Sharwari Inkane

photo
1

Sharwari,

I am hoping to get to this today, but it may be next week. I took a first glance and tried to replicate exactly as the screen recording, but was not able to get it to pull up the dashboard from my "test.html" on my Desktop. I will do more testing as soon as I can.


Thanks,

Zack

photo
1

Hello Zack,

Thank you for the update. Take you time with the testing. If you encounter any issues or need assistance, feel free to reach out. We are here to help.

Have a great day!

Regards,
Sharwari Inkane

photo
1

Hello Zack,

Hope you are doing well. I just wanted to check if there are any updates on this?

Regards,
Sharwari Inkane

photo
1

Sharwari,

I may have found something.. However, I am not sure what to do with it!

I was able to add the embedded script into a file, save it as html, open it in a browser, and... it worked! So, I had to figure out what was different. This is what I found:


<script
type="text/javascript"
src="https://yellowfin.smithbro.com/JsAPI/v3?dashUUID=ee6aa83c-8464-4c68-83b9-5107da521b58"
></script>
This works!


<!DOCTYPE html>  <!-- <--Including this causes the issue. -->
<script
type="text/javascript"
src="https://yellowfin.smithbro.com/JsAPI/v3?dashUUID=ee6aa83c-8464-4c68-83b9-5107da521b58"
></script>
When I include the "<!DOCTYPE html>" it breaks the CSS...


Hopefully this helps explain what is happening...

Thanks,

Zack

photo
1

Hello Zack,

Thanks for your response. I have forwarded your response to the product team. I will update you once I received any response from them.

Regards,
Sharwari Inkane

photo
1

Hello Zack,

I have received below response from product team.

"The doctype declaration basically tells the browser what type of document to expect. The doctype also serves to make the browser render the page in so called 'standards mode'. In standards mode, browsers generally try to render the page according to the CSS specifications.

On the other hand, if a browser finds an outdated, incomplete of missing doctype at the start of the page, they use “quirks mode”. The differences are mostly related to how CSS is rendered. Different browsers behave a bit differently in these cases and I can not say for sure the reason for the difference in the behavior."

If omitting the doctype declaration resolves the issue with the drill anywhere pop-up position and if you find this satisfactory, may I proceed to close this ticket? Please let me know if you have any additional questions or concerns.

Regards,
Sharwari Inkane

photo
1

Sharwari,

I am interested to know if they were able to replicate the issue? I believed most of my boxes have been checked and you can close the ticket after I know I am not crazy. ;)


Thanks,

Zack

photo
1

Hello Zack,

Thanks for your response. I will check with the product team to confirm if they were able to replicate the issue. Once we have confirmation, I will provide you with the details.

Regards,
Sharwari Inkane


photo
1

Hello Zack,

I have received a response from the product team. They tried both with and without a Doctype declaration. They got the same results; the 'Drill Anywhere' popup position is as expected. They are using Mozilla Firefox Developer Edition browser v118.0b9 (64-bit) and running the latest version of Yellowfin on their local environment.

Please let me know if you have any questions or concerns.

Regards,
Sharwari Inkane

photo
1

Hello Zack,

I hope all is well,

I just want to touch base to see if you had a chance to read through my response. If you can let me know that would be great.

Regards,
Sharwari Inkane

photo
1

Sharwari,

Yes. I saw your response. I sure wish I could figure out why on my end it is doing that. However, I don't believe it is a deal breaker, by any means.


Thanks,

Zack

photo
1

Hello Zack,

Thanks for your response. I really appreciate it. I would like to confirm if there is anything else I can assist you with or if you have any additional questions or concerns. If not, I will proceed to mark this ticket as completed. Please feel free to let me know.
Thank you !

Regards,
Sharwari Inkane

photo
1

Hello Zack,

I hope all is well,

I just want to touch base to see if you had a chance to read through my response. If you can let me know that would be great.

Regards,
Sharwari Inkane

photo
1

Hello Zack,

Greetings for the Day.

This is a follow up reminder that 2 days have passed without any activity in this ticket. When there's no activity, it usually means either that you have identified the solution for the reported issue or that the matter is no longer relevant and after 5 days (2 days from now) without any activity, we assume that the ticket can be closed.

If this is not the case, please do reply and let us know how we can be of further assistance, we would be happy to assist.

Regards
Sharwari Inkane

photo
1

Sharwari,

Go ahead and close it.

-Zack

photo
1

Hello Zack,

Thank you so much for your response. I really appreciate it. I will now go ahead and mark this case as completed. Feel free to contact us with any questions or concerns; we would be more than happy to assist you.

Have a great rest of your day!

Thanks!

Regards,
Sharwari Inkane

Leave a Comment
 
Attach a file