Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

UIB - page refreshing continuously, events set up wrong? UIB help

David Nendza
Tera Guru

Hello all, I am trying to use UIB to make a front end to do operations on an external system, and this front-end dev stuff really isn't my strong suit.  

 

I have the UI page set up with -

Input box, button

Contact card | contact card

repeater -> card container.

 

I need the user to input a username into the input box, then when the button is pressed it takes this user name and:

  • queries the user table to check that it's valid and a user
  • queries a remote table with the user name and pulls in the remote-specific user ID
  • queries a 3rd table with that remote-specific ID to pull additional user information over.

I have this set up with multiple data resources.

 

The issue I'm encountering is that when testing the page, upon hitting the 'submit' button it gets the info and then 2 seconds later it refreshes the page and keeps doing that until all the data is gone from the page (I assume it's refreshing with 'null' as the input).  If I bring up the browser console I just keep getting a bunch of errors with one of them being - Uncaught TypeError: Cannot read properties of null (reading 'elm').

 

I have the data resources set up with 'when to evaluate this data resource' as 'only when invoked (explicit)'.  Events are set up like -

  1. Input button: Button clicked -> REFRESH data resource (user lookup)
  2. Data Resource (user lookup): data fetch succeeded -> (1) set loading state, (2) refresh my contact card data broker, (3) refresh the remote table user lookup data source
  3. Data Resource (remote table user lookup data source): data fetch succeeded -> (1) refresh contact card data (this goes to a 2nd contact card), (2) refresh remote table additional info lookup data source, (3) set client param
  4. Data Resource (remote table additional info lookup data source): data fetch succeeded -> set loading state (off).

Now, I obviously have something set up wrong because it's refreshing over and over.  What do I have to do if I want it to do nothing until the submit button is pushed, and then flow through the process once, instead of it refreshing over and over?  Do I need to use a different input?  

 

 

1 REPLY 1

tomasscerba
Mega Sage

Hi @David Nendza ,

 

Most probably event loop so one DR will refresh another DR, and they are triggering one another in loop. I would have to see the whole implementation to spot the problem. I would suggest creating 1 custom either transform or GraphQL data resource to query everything at once and get back data you need.