Hoe to access master form record data in confiforms?
Asked by Piotr Gugnowski:

I have master form, where I store row that have page link column leading to the details of that row. Inside those details pages I have inner forms that shall modify master form via integration rules.

How can I access respectful master form row data in that inner form. I would like to know the id of a row that is related to the details page that my inner form is located.

Could you please show me the demo? It would be cool if you showed for example populating master record with inner form entries via queryAndSet.

[@Alex Medved _ConfiForms_](/t5/user/viewprofilepage/user-id/781630)


Answers:
author: Alex Medved _ConfiForms_
body: To edit records in ConfiForms you need to add a view over your form and drop ConfiForms Edit Controls macro

Example of the editable TableView - <https://wiki.vertuna.com/display/CONFIFORMS/Multiple+ways+to+show+your+form+data+in+Confluence+with+ConfiForms#MultiplewaystoshowyourformdatainConfluencewithConfiForms-Editabletable>

Alex

comments: author: Piotr Gugnowski
body: No no, this is not what I am looking for. :D

I want master record to be updated automatically when I modify inner form. So i need to somehow access respectful master record row id inside inner form integration rule.

Could you please show to how to store that row id data inside master row inner page and then access it inside inner form integration rule filter?


author: Alex Medved _ConfiForms_
body: If you use smart fields in ConfiForms then you can link records from different forms

(it is basically a link already - nothing needs to be done as an extra)

See

<https://wiki.vertuna.com/display/CONFIFORMS/Master+Detail+forms+or+how+to+show+data+from+2+forms+which+are+referenced+using+ConfiForms+smart+fields>


author: Piotr Gugnowski
body: And how this linking would go?

How can I (without manual selection) get the information about the master form record id that my inner form is related to (that means: inside master record details page). This information has to be accesible inside inner form integration rule.

The problem is that inside inner form i want to modify master record via integration rule. But i cant do it because i do not know which master record to modify without knowing related master record id.

Details pages are created automatically when new master record is created


author: Alex Medved _ConfiForms_
body: How does a master form "knows" where in the details forms it is used?

There is no such link, as if you have a smart field in your details form then only the details form has this information

Links are not bidirectional

I dont understand what you are saying about "created automatically pages" and "want to modify master record via integration rule".

Alex


author: Piotr Gugnowski
body: Ok, I will try to be as precise as possible when describing a situation. I see that I confused you.

The structure that I will be taking about:

There is a page 'Projects' where i have confiform form with projects listed. Fields: projectName, relatedPeople (smart multiselect field), details (link to the 'project details' page that is created thanks to integration rule with onCreated event and this page name is ,\[entry.projectName\] - Details').

Details page structure:

It has form that has field: relatedPeopleInner (smart dropdown)

I want this form to cause an update on respectful row on 'Projects' page in such way that all entries from this form would populate relatedPeople field.

The problem that I encounter is that I dont know how to get the respectful row id to update correct row inside 'Projects' page form and how to actually use queryAndSet to modify relatedPeople field via integration rule because syntax shown in docs (virtual functions) doesnt match key=value syntax inside integration rules.

Could you please show me how to do it?

I tried to get correct 'Projects' row id by storing that id value while creating details page inside html on page: \<div class="x"\>\[entry.projectName\]\</div\> and then access it inside inner form integration rule via AJS.$("div.x").val() but it doesnt work.


author: Alex Medved _ConfiForms_
body: Record id is stored in "id" field (<https://wiki.vertuna.com/display/CONFIFORMS/Documentation>)

Why would you need to modify some other form and not the data directly in the master form (from a created page)?

And even if you want to use some other form and do whatever you want to do - you still can get the \[entry.id\] injected into your created page that that expression will be evaluated to the id of the record from project form (used to create the page) which you then can use to link back whatever you want

<http://recordit.co/06CInkqHrE>

Alex


author: Piotr Gugnowski
body: WOW thank you! This was so confusing for me, because I thought \[entry.id\] would refer \[entry.id\] of inner form.


Tags: confiforms

confluence-server

server