08-11-2022 02:13 PM
Hi altenbach,
(just noticed I had your handle incorrect, apologies).
that video is really hard to look at, are the slides posted somewhere?
08-11-2022 02:16 PM
We can't tell you why you have a problem since you didn't post your code. And being salty at the people trying to help you for free isn't going to win you a lot of support.
You seem to be missing the point of the Maps. Maps will let you greatly speed up your searching, and you can still use the cluster if you want. You'd just store the reference to each internal control as the Value in the map, using its label as they key. You can probably do away with the cluster entirely by just iterating over the entire cluster, creating the map in one go. The key would then be the cluster element name, the value is the value you want to store.
Either way I get that you don't want to replace that, you just want to know what's going on with your code, but you haven't posted code so we don't know why it's not working. You just posted a partial image; we cannot debug images.
08-11-2022 02:16 PM
Just a suggestion, but if I had your use case I would go direct from JSON to the PDF form, skipping any intermediate representation. I would use the JSONtext library.
08-11-2022 03:02 PM
@xfrmrs wrote:
that video is really hard to look at, are the slides posted somewhere?
(I meant that Maps are better than variant attributes and both are way superior to whatever you were doing 😄 )
A link to the slides is right under the video. (Yes, I agree that the recording is not that great.)
08-11-2022 03:50 PM
HI altenbach,
there may still be a misunderstanding,
suffice to say that i am not using the variant attribute _instead of_ using a map, but what i am doing gets super complicated to write up in any worthwhile detail, though i'll make a go of it ...
QA requires that the fields generated by the application be matched to the fields extracted from the PDFs prior to pushing the data into the PDF. hence the need to match the labels (or keys) from the PDFs with the generated labels (or keys),
each report has a distinct type def which is programmatically created based on the fields in the PDFs, these are compared the labels generated by the application to satisfy the QA requirement (of ensuring the data is placed in the right places in the PDFs).
it's the QA part which requires matching up the labels from the PDF with the labels generated by the application. without that, i could simply generate the map and push that into ... the PDFs..
08-11-2022 03:53 PM
hi drjdpowell,
i'll look into the JSONtext lib. thanks for the suggestion.
08-11-2022 04:10 PM
it's not that i want to keep the clusters, nor that i don't grok the map, nor that i just want to know what broken in my code. it's that the tool to automate the extraction of the PDF fields generates the clusters. there may be better tools for that part, which is why i asked the bigger picture question.
the point is to match the field names generated by the application to the field names in the PDFs, not searching the values.
as i mentioned this morning, i found the issue in the code this morning. your (and altenbach's) point about the partial code, is well taken, though perhaps not well delivered...
as for being salty, well, i suppose we could do with less of that.
08-11-2022 05:08 PM
HI folks,
(update)
just to see how clean using maps made the construction, I recreated the data structure containing the labels and values using maps rather than using property nodes to facilitate matching the labels in the pre-existing clusters and stuffing the values..
as noted before, the populated data structure is then pushed out as a JSON string.
only to find out that the built-in "Flatten to JSON" polymorphic function does not work with maps.
thanks for all the discussion.
08-11-2022 05:22 PM - edited 08-11-2022 05:22 PM
You can still use the clusters- just create your map using key/value of cluster label/element reference. Then, instead of searching through ALL of the labels for EVERY value, just index the map by your value name. Now you have a reference and can write to the property node. Now you search the whole names array once instead of every single time.