Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
11

Process improvement: update of dropdown list across multiple files

Participant ,
Nov 29, 2023 Nov 29, 2023

Hello Guys,

 

I created a fillable form with a drop-down list of the employees's names and licenses. This drop-down list is used in multiple different forms. Every time I have a new employee hired/leaving I update each form dropdown list. I am wondering if there is a way to make this process faster or even to automate it. Any suggestions? 

 

Thank you.

TOPICS
PDF forms
687
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 29, 2023 Nov 29, 2023

Hi,

If the drop-down list field has the same name on all forms, it's possible to write an JavaScript action wizard to modify all the forms.

@+

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Nov 29, 2023 Nov 29, 2023

Thank you, bebarth. I am pretty new to Javascript. Would you have any content/courses to suggest?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 29, 2023 Nov 29, 2023

The dropdown fields have the same name in all the forms?

Do you know how action wizards operate?

Could you give me an example of the items (and export values) for the dropdown field... and its name!

@+

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Nov 29, 2023 Nov 29, 2023

Yes, the same names and numbers will be for all forms.

I don’t know how to use the action wizard. I checked and I have six actions available on it as you can see in the image below.

Name: NameLicense

I had no export values entered, just the names and numbers under the item list. Should I have it under export?

Item List example:

Daniela Barros – 111222

Marcel Short – 222333

Mary Stal – 444555

 

DanielaBarros_0-1701294222434.pngexpand image

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 29, 2023 Nov 29, 2023

You can use an Action with this code to do it:

 

this.getField("NameLicense").setItems(["Daniela Barros – 111222", "Marcel Short – 222333", "Mary Stal – 444555"]);
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 29, 2023 Nov 29, 2023

Here is my proposal.

Open your first form.

The first time, you will have to create the action wizard.

Capture_d’écran_2023-11-30_à_00_59_25.pngexpand image

Then give a name to your action.

Capture d’écran 2023-11-30 à 01.03.26.pngexpand image

and it will appear at the top of the list.

Capture_d’écran_2023-11-30_à_01_03_45.pngexpand image

Click on the action wizard then on "Add Files...". If all your forms are in a same folder, you can click "Add Folder..."

Capture d’écran 2023-11-30 à 01.07.15.pngexpand image

Select all the files you want to modify then click "Start"

Capture_d’écran_2023-11-30_à_01_11_26.pngexpand image

All the files will be modifyed. The selected item of each file will be kept if it still exist.

Capture_d’écran_2023-11-30_à_01_14_56.pngexpand image

 

The script to paste for the action wizard is:

 

 

 

var fieldName="NameLicense";
try {
	var selectedItem=this.getField(fieldName).value;
	this.getField(fieldName).setItems(["- Select a Name -","Daniela Barros – 111222", "Marcel Short – 222333", "Mary Stal – 444555"]);
	try {
		this.getField(fieldName).value=selectedItem;
	} catch(e) {};
	this.saveAs(this.path);
} catch(e) {
	app.alert("The dropdown field \""+fieldName+"\" doesn't exist on this form.",2);
}

 

 

 

I hope that will help you...

@+

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 30, 2023 Nov 30, 2023
LATEST

Another solution is to place employees's names and licenses in a CSV file attachment.

So you will update all PDFs just by replacing the attachment.


Acrobate du PDF, InDesigner et Photoshoptographe
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines