How to synch data on page created by confiforms using IFTTT/Plainview view.
Asked by Patrick Liang:

I used plainview (many custom html + fields like \[entry.image\], \[entry.bg\], etc.) inside IFTTT macro to create a new page when there is a new record in my form.

However when the page is created, every field inside the plainview is rendered as static value unlike the list view that will keep the fields macros inside it.

The issue is that when I edit my form data, the page with plainview will not be refreshed. If I use list view with field macro, the data can be refreshed, however, I cannot do custom HTML with listview because these fields are not rendered as raw value.

Is there any other way that I can customize the "new page" but also keep the data synchronized if I edit form data?

Thanks,

Patrick


Answers:
author: Alex Medved _ConfiForms_
body: Hi

This is the difference between the macros and what they offer. One offers static view of the data (snapshot) while another is an "online view" over the data

An option is to re-create the page each time the data is changing or switch to ListView/CleanView instead and have a realtime data rendered every time you see the page

Alex

comments: author: Patrick Liang
body: Thank you for the quick response, Alex!

I do understand that plainview offers snapshot and other views offer "online view" over data. However, I think that it makes more sense to have the option to have a "render as raw" option for the cleanview so it doesn't add any wrapping HTML around the field value so we can manipulate data better and also when the data is in the created page, we have the flexibility to customize UI but also keep data synchronized instead of snapshot.

Re-creating page is an alternative but has its own limitation - the comments and any additional edits on that page will be purged.

So far I had to write some custom javascript to read data from tableview/cleanview then write back to the placeholder elements on created pages in order to keep the data on these pages synchronized.

Thanks,

Patrick


author: Alex Medved _ConfiForms_
body: After thing about this more I really don't quite understand what is here to "sync", as when you use any view macro from ConfiForms it will be an ONLINE representation of the data, be it via view macros that expect a ConfiForms Field macros (ListView, Table/Card views) or \[entry.field_name\] notations (PlainView, can also be used with CleanView and ListViews)

![Screenshot 2022-06-20 at 07.33.52.png](https://community.atlassian.com/t5/image/serverpage/image-id/202527iC8D9EA55BDB57241/image-size/large?v=v2&px=999 "Screenshot 2022-06-20 at 07.33.52.png")

Unless you have something like a page create IFTTT that takes a snapshot of data and process all the \[entry.field_name\] expressions when the page gets created

In this case you can tell ConfiForms not to process expressions by using the "[rawtemplate](https://wiki.vertuna.com/display/CONFIFORMS/Using+Confluence+templates+from+ConfiForms+with+dynamic+names)" or use the [asEntryRef](https://wiki.vertuna.com/display/CONFIFORMS/Virtual+functions) virtual functions to workaround this

Alex


author: Patrick Liang
body: Hi Alex,

I have 2 pages:

**- Page A: parent page to create a new page**

-- There is a IFTTT macro to create a new page (page B for example) after a new record is created in a form on this page.

-- Inside the IFTTT macro: there is a template for the child page using HTML and plainview. Something like this:

----------IFTTT integration rules--------------  
---------------------------plain view----------

-- \<Div id="testid1"\>\[entry.myfield\]\</div\>--

------------------------------------------------

------------------------------------------------  
![screenshot1.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/202599i1D55DC27D0ED5BB9/image-size/large?v=v2&px=999 "screenshot1.PNG")

**- Page B: created by page A**

-- When this page is created by IFTTT, the \[entry.myfield\] inside the plainview of the IFTTT macro on the parent page A is instantized \[entry.mfield\] becomes value instead of \[entry.mfield\]) so it now lost the connection to the data. Because it is now pure HTML instead of plainview any more. Something like this  
---------------------------plain view----------

-\<Div id="testid1"\>value of myfield\</div\>-

------------------------------------------------

![screenshot2.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/202600i9CCDA2454DA8F896/image-size/large?v=v2&px=999 "screenshot2.PNG")

-- On the other hand, if I used list view + field macro inside IFTTT macro, the page B will have the list view + field macro instead of values. So the value will be still synchronized with the form defined in page A.


author: Patrick Liang
body: The [asEntryRef](https://wiki.vertuna.com/display/CONFIFORMS/Virtual+functions) function seems to work as desired. Thank you so much, Alex!!


Tags: cloud

confiforms

confluence-cloud