Dynamic Print Help
1. In the Domains to Audit Column I need every Domain in different line.
2 in the second image the Domains is a Multiple dynamic Choice with all domains.
3. In the next image the dynamic print
7 replies
-
what does your JSON look like?
can show the doc file used to create the tables?
-
Here is what is going on. In your code you have:
let vObj := vTbl.{ vDat: format(Date, "DD.MM.YYYY"), vHour: format(From, "hh:mm"), vProj: Projects.'Project Name', vDom: text(Domains), vDatArr: let xDat := Date; vTbl[Date = xDat].Date };
In line 5, you only grab the text values of the values in the Domains multichoice field.
So that shows up as:
"vDom":"4 Gestión del Cronograma del Proyecto, 5 Gestión de Costos",
It is a simple string of text. Which means there is no way for Ninox to tell that there are multiple items to separate out.
Since you want to have an array of the choices in the dynamic multichoice field, you will need to use a for loop command to get to the actual records then create a sub array of the data you need.
You can replace the above with:
let vObj := vTbl.{ vDat: format(Date, "DD.MM.YYYY"), vHour: format(From, "hh:mm"), vProj: Projects.'Project Name', vDom: for domain in numbers(Domains) do let domRec := record(DOMAINS,domain); domRec.{ vPMI: 'PMI Dominio', vDName: 'Domain Name' } end, vDatArr: let xDat := Date; vTbl[Date = xDat].Date };
Line 5 now extends to line 11. Now the JSON looks like:
"vDom":[{"vPMI":"4","vDName":"Gestión del Cronograma del Proyecto"},{"vPMI":"5","vDName":"Gestión de Costos"}],
You can see a subarray is created and each choice is separated into its own curly bracket.
Now you can modify your dynamic print form, which I'm not very good at, to point to each vDom and the subsequent subfields.
Content aside
- Status Answered
- 4 mths agoLast active
- 7Replies
- 72Views
-
2
Following