Running Javascript from Confiform IFTTT
Asked by Chris Iacovelli:

I am trying to run a js snippet from an IFTTT in confiforms.

The triggering event is determining of the current status has changed. I know the status is changing (specifically intakeCurrentStatus.id as it is a drop down) as I can see the before and after states.![run js on modified.png](https://community.atlassian.com/t5/image/serverpage/image-id/261078i9939F648F0EF145F/image-size/large?v=v2&px=999 "run js on modified.png")

I have tried dropping the windows. (hangs), i have tried just checking the status (hangs), i have tried checking the label (doesn't hang but no refresh - same behavior if I check the id), no luck.

Any suggestions?


Answers:
author: Alex Medved _ConfiForms_
body: Hi

Just have it as a

```
window.reload()
```

Full example (try updating value in a form and you will see page reload):

```
<ac:structured-macro ac:macro-id="17ee5937-a2c6-47da-a183-757db38f4ff5" ac:name="confiform" ac:schema-version="1">
<ac:parameter ac:name="formName">f</ac:parameter>
<ac:rich-text-body>
<ac:structured-macro ac:macro-id="fd7a73ba-3089-464e-a529-62741f0576cd" ac:name="confiform-entry-register" ac:schema-version="1">
<ac:rich-text-body>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p>
<ac:structured-macro ac:macro-id="3f9bd56b-12af-4b26-afc5-26fe8e7235a3" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">status</ac:parameter>
<ac:parameter ac:name="fieldLabel">Status</ac:parameter>
<ac:parameter ac:name="type">text</ac:parameter>
</ac:structured-macro>
</p>
<ac:structured-macro ac:macro-id="44479a9b-c110-40a2-88f4-928f72040c10" ac:name="confiform-ifttt" ac:schema-version="1">
<ac:parameter ac:name="condition">hasChanged(status):true</ac:parameter>
<ac:parameter ac:name="action">Run JavaScript</ac:parameter>
<ac:parameter ac:name="event">onModified</ac:parameter>
<ac:rich-text-body>
<p>location.reload()</p>
</ac:rich-text-body>
</ac:structured-macro>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
```

Alex


author: go-like
body: \<ac:structured-macro ac:macro-id="17ee5937-a2c6-47da-a183-757db38f4ff5" ac:name="confiform" ac:schema-version="1"\>

\<ac:parameter ac:name="formName"\>f\</ac:parameter\>

\<ac:rich-text-body\>

\<ac:structured-macro ac:macro-id="fd7a73ba-3089-464e-a529-62741f0576cd" ac:name="confiform-entry-register" ac:schema-version="1"\>

\<ac:rich-text-body\>

\<p\>

\<br/\>

\</p\>

\</ac:rich-text-body\>

\</ac:structured-macro\>

\<p\>

\<ac:structured-macro ac:macro-id="3f9bd56b-12af-4b26-afc5-26fe8e7235a3" ac:name="confiform-field-definition" ac:schema-version="1"\>

\<ac:parameter ac:name="fieldName"\>status\</ac:parameter\>

\<ac:parameter ac:name="fieldLabel"\>Status\</ac:parameter\>

\<ac:parameter ac:name="type"\>text\</ac:parameter\>

\</ac:structured-macro\>

\</p\>

\<ac:structured-macro ac:macro-id="44479a9b-c110-40a2-88f4-928f72040c10" ac:name="confiform-ifttt" ac:schema-version="1"\>

\<ac:parameter ac:name="condition"\>hasChanged(status):true\</ac:parameter\>

\<ac:parameter ac:name="action"\>Run JavaScript\</ac:parameter\>

\<ac:parameter ac:name="event"\>onModified\</ac:parameter\>

\<ac:rich-text-body\>

\<p\>location.reload()\</p\>

\</ac:rich-text-body\>

\</ac:structured-macro\>

\<p\>

\<br/\>

\</p\>

\</ac:rich-text-body\>

\</ac:structured-macro\>


Tags: confiforms

confluence-server

server