Getting error "domo.OnDataUpdate is not a function"

Options
sourabh05
sourabh05 Member

Here's the code I am using in my main app.js

domo.OnDataUpdate(()=>{  
console.info('domo.OnDataUpdate: ', new Date().getTime());  
errorE1 = document.querySelector('.error-msg');  
errorE1.innerHTML += "Refresh page to update data in the app";});

Errorscreenshot:

image.png
Tagged:

Answers

  • You need to use a lowercase o for onDataUpdate.

    https://developer.domo.com/docs/guides/handling-data-updates?category=/docs/embed/embed-2

    **Was this post helpful? Click Agree or Like below**
    **Did this solve your problem? Accept it as a solution!**
  • sourabh05
    sourabh05 Member

    That was it. Thanks, @GrantSmith . Although, I do have a follow up. I was able to update the function and run it but for some reason this function does not trigger.

    what I am trying to do is to not refresh the app when the underlying dataset updates. This is causing lot of problems when users are updating information and app refreshes in the middle of the update.

    But for some reason this function does not trigger. When the dataset updates, it still refreshes the app without executing this function at all. Any potential troubleshooting suggestions?

  • ArborRose
    ArborRose Coach
    edited July 2

    domo.onDataUpdate() triggers after the dataset updates. It's not intended to prevent the refresh. So you can react to data changes, but not intercept them.

    You may be able to do a work-around by writing to a temporary staging dataset. Then schedule an ETL to move the data.

    ** Was this post helpful? Click Agree or Like below. **
    ** Did this solve your problem? Accept it as a solution! **

  • sourabh05
    sourabh05 Member

    I was following this documentation precisely for the reason it mentions that it is a bad user experience if the app refreshes every time the underlying dataset updates.

    image.png