AdditionalScope is not working in IFrame Code

Hello,
I am trying to trigger a query ( called query17) in JS Code.
image
But if I run this JS code, there is an error like:
image
I already have 'query17'
image
What am I doing wrong here?

hello welcome to the community.
at the bottom right there is debug icon. click it and open state tag find query17, and share screen shots here. I want to check details of query17

1 Like



image
Thanks for your reply.

so weird. Do you mind to share your export app json file ? don't remember to remove sensitive information.

AnsonHwang, Thanks for your reply.
I was wrong before now .
I have written code in Iframe code in Custom component.
image
Is it not working?
Please reply to me.

oh, in the iframe you can't visit the query in app

why not use custom component which can trigger query in app

How can I do that?
Could you give me some examples, please?
I used custom component using HTML.

Can I use modelUpdate instead of additionalScope?
If I can, please give me steps of using.

Hello, I don't find way to use additionalScope in custom component.

Yes, you can try to use modelUpdate.

Steps:
reference {{customComponent1.model.name}} in query
update name in model within custom component
modelUpdate({ name:"a"})}

Then when the name in model will update, the query will run automaticlly

Thanks for your reply.
But when the name in model updated, the query didn't run automatically.
So I have written like this.


What do you think about it?

And please answer my topic: "There is an error for modelUpdate".
I can't understand why this happens.

with this code, the query run many times as you said in another post?

Could you share exported sample app json?

Hi @Ice, welcome to the community :hugs:

Can you share a bit more info on what you're trying to do exactly? I'm missing where the iFrame comes into play.

Are you updating a Retool table (table1) after a date input is changed and need to reload an iFrame?

Also, I would use the GUI version to update Retool DB tables, bit cleaner.