Skip to main content
November 19, 2024
Question

Loss of format from adobe webform calculated fields in completed agreement (PDF)

  • November 19, 2024
  • 6 replies
  • 948 views

Hi community,

 

I am, after much trial and error, approaching the finish line on a webform for my organization. I used the Adobe Sign webform included with Acrobat Pro, so I don't have access to the advanced Adobe Sign enterprise features. In the webform calculcated field, I am returning a summary of earlier time entries as a weekly schedule. I have provided a sample of the syntax below:

"Monday: " + (if(and([Parent or Guardian 2 - Monday Shift Start] != "", [Parent or Guardian 2 - Monday Shift End] != ""), [Parent or Guardian 2 - Monday Shift Start] + " - " + [Parent or Guardian 2 - Monday Shift End], "OFF")) + "\n" +"Tuesday: " ............ "\n" +"Friday: " + (if(and([Parent or Guardian 2 - Friday Shift Start] != "", [Parent or Guardian 2 - Friday Shift End] != ""), [Parent or Guardian 2 - Friday Shift Start] + " - " + [Parent or Guardian 2 - Friday Shift End], "OFF"))

When I embed the webform and run some sample data in the fields above, the calculated field returns:

Monday: 13:00 - 15:18
Tuesday: OFF
Wednesday: 13:00 - 15:00
Thursday: OFF
Friday: 14:00 - 15:00

I'm not in love with the military time but I'm not super stoked to try to sort that mess out. But, this is the desired format and the data have been matched correctly; but, when I receive the completed agreement and open the pdf, the result is formatted like this (different sample):


Monday: -25203.408333333 - - 25203.90833333333

Kind of at a loss as I'm still getting used to the differences in webforms from a traditional fillable pdf. Any help would be much appreciated, thanks!

 

 

 

 

6 replies

JR Boulay
Community Expert
Community Expert
November 20, 2025

Hello S. S
When will this very annoying bug be fixed?

Acrobate du PDF, InDesigner et Photoshopographe
JR Boulay
Community Expert
Community Expert
March 10, 2025

S. S  ???

Acrobate du PDF, InDesigner et Photoshopographe
Souvik Sadhu
Community Manager
Community Manager
July 15, 2025

Hi @JR Boulay,

 

Sorry for the delayed response.

 

No updates yet. Still a work in progress.

 

I will update the thread once I hear something tangible from the team.


Regards,
Souvik.

JR Boulay
Community Expert
Community Expert
November 21, 2024

GRANTLY: (and S. S)

In fact, it would work properly if the PDF was flattened just before it was signed, which would allow it to keep the formats and calculation results intact.
Unfortunately Adobe still hasn't understood this.

Acrobate du PDF, InDesigner et Photoshopographe
Souvik Sadhu
Community Manager
Community Manager
November 21, 2024

Thanks @JR Boulay @25268354 for this.

 

Let me take this up with the team and circle back to you.

 

-Souvik

JR Boulay
Community Expert
Community Expert
November 20, 2024

Changing the appearance and content of a document when it is signed is prohibited in many countries, including my own.
I've been reporting this problem to Adobe for over 10 years now, without success.

Acrobate du PDF, InDesigner et Photoshopographe
November 21, 2024

@JR Boulay I had assumed this was potentially a flattening issue during converstion to an actual PDF. But I'm now thinking that even though the webform field is calculated and set to display as text, that the time values I'm pulling are still being treated as numbers and not strings. As I can't use a text() function, the only workaround I can think of is to use a datePart function and individually call all the numbers, but that will be a monster formula. Again, AI writes most of my functions at this point so I may be overcomplicating it. 

try67
Community Expert
Community Expert
November 20, 2024

Adobe Sign offer a very limited support for scripts.

Souvik Sadhu
Community Manager
Community Manager
November 20, 2024

Hi @25268354,

 

Hope you are doing well. Thanks for writing in! 

 

Web forms are a simplified version of what you see on a traditional fillable PDF. Any scripts that work on the fillable PDF will not work on a web form, and the result will always be a text field return text values compared to the script calculation.

 

Next, if you are looking to work with the same script on a fillable form on Acrobat, you can make a few changes to change the time format from a 24-hour to 12-hour.

You can try this:

// convert decimal time to AM/PM format
function formatTimeToAMPM(decimal) {
    // Convert decimal time to hours and minutes
    var hours = Math.floor(decimal);
    var minutes = Math.round((decimal - hours) * 60);
    
    // Convert 24-hour time to 12-hour AM/PM format
    var period = hours >= 12 ? "PM" : "AM";
    var hour12 = hours % 12;
    if (hour12 === 0) hour12 = 12; // Handle midnight (00:00) and noon (12:00)
    
    // Pad minutes with leading zero
    var formattedTime = hour12 + ':' + (minutes < 10 ? '0' : '') + minutes + ' ' + period;
    return formattedTime;
}


var mondayStart = [Parent or Guardian 2 - Monday Shift Start]; // assuming this is in decimal hours
var mondayEnd = [Parent or Guardian 2 - Monday Shift End];

var mondayShift = (mondayStart !== "" && mondayEnd !== "") ? formatTimeToAMPM(mondayStart) + " - " + formatTimeToAMPM(mondayEnd) : "OFF";

var result = "Monday: " + mondayShift + "\n" +
             "Tuesday: " + (TuesdayStart !== "" && TuesdayEnd !== "" ? formatTimeToAMPM(TuesdayStart) + " - " + formatTimeToAMPM(TuesdayEnd) : "OFF") + "\n" +
             "Wednesday: " + (WednesdayStart !== "" && WednesdayEnd !== "" ? formatTimeToAMPM(WednesdayStart) + " - " + formatTimeToAMPM(WednesdayEnd) : "OFF") + "\n" +
             "Thursday: " + (ThursdayStart !== "" && ThursdayEnd !== "" ? formatTimeToAMPM(ThursdayStart) + " - " + formatTimeToAMPM(ThursdayEnd) : "OFF") + "\n" +
             "Friday: " + (FridayStart !== "" && FridayEnd !== "" ? formatTimeToAMPM(FridayStart) + " - " + formatTimeToAMPM(FridayEnd) : "OFF");

console.log(result); // Outputs the formatted result

Hope this clarifies your question.


-Souvik

November 21, 2024

Hi Souvik,

 

Thanks for your reply! Yes, I've discovered how different calculated fields in webforms are from those in Acrobat. The fomrulas I provided were already modified to work with webforms and I already have working calculations in the original Acrobat documents.

 

In the webform, the output was set to 'text' and the calculations display correctly when the webform is actively being edited. However, when I view the completed agreement, these fields are no longer even in military time format, but some other time format. 

 

My confusion lies in why the webform displays properly during filling, but the data are not correct in the final document.