Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Add a unique row number to a dynamic form

Avatar

Level 1

Our engineers use a Dynamic PDF form to complete their dailiy activities.

I now want to import this data in XML to SQL. However I need a unique row number for each line entered.

Does anyone know how to scipt this in Java?

The layout of the dynamic form currently is:

Date - Activity Code-JobNo-StartTime-EndTime

The engineer adds more rows as necessary.

Want I want is :

IDNo-Date - Activity Code-JobNo-StartTime-EndTime

Regards

Chris C

1 Accepted Solution

Avatar

Correct answer by
Former Community Member
5 Replies

Avatar

Former Community Member

We use our Pesticide recertification form the same way.  However, we distribute the form

and when it is returned it is exported into XML and our SQL server identifies new entries and transfers the data to tables.

If you email me directly, I will send you an example form with the script.  I can't figure out how to attach it from the forum.

Avatar

Level 1

Hello Ida,

Thanks for replying.

If you could send me an example form with script that would be very helpful.

Overall I find LifeCycle very good and have been using it for past three years but there are always things I need to add. I only discovered there was this forum recently.

Regards

Chris Chalcraft

Avatar

Former Community Member

Same here, I find myself referring back to the forums when I need add new features to forms for my agency.

The attached form has the following:

1. Unique Form ID creation. Every time the form opens, it generates an unique ID.

2. Read only fields w/secret space. Author of the form must know the a combination of words to access the secret space. For this example: Enter Tree in the cell after the save button and Frog after that cell to display secret space to enter read only text.

3. Unlimited dynamic table rows. Only way I could get unlimited rows was by using a button.

Functionality:

Staff enters the data and emails a distributed form to someone. They fill it out and return it via email. From there, it is add to a portfolio and exported in XML and saved in a specified location. From there, the SQL server identifies the new XML entry and uploads it into the table by using stored procedures and triggers.

Other options you might want to consider is binding your form fields to the SQL table directly. Don't know how to do that with dynamic table rows though, never had to do it with any of my forms....yet.

I. Eve Tracy

Avatar

Level 1

Hello Ida,

Thanks for the reply. I did not receive a form with your e-mail? Possibly my virus checker stripped it out. Could you please re-send.

Thanks

Regards

Chris C

Avatar

Correct answer by
Former Community Member

Here you go.

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----