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

Extract form values to a XML file using JS actions

Community Beginner ,
Oct 27, 2022 Oct 27, 2022

Hi
I'm trying to get values of some specific form fields and then generate a XML file based on that data using JS actions when a user clicks a button. It's possible to get those values but I'm not sure how to generate that xml and provided to the user. Any help would be appreciated.

TOPICS
JavaScript
1.1K
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
1 ACCEPTED SOLUTION
Community Expert ,
Oct 27, 2022 Oct 27, 2022

Hi,

Try this attached file and the action wizard included (not possible to save the xml file from the button).

Script:

var spans=this.getField("text1").richValue;
var str=util.spansToXML(spans);
this.createDataObject("theFile.xml",str);
var spans=util.xmlToSpans(str);
this.getField("text2").richValue=spans;
this.getField("text3").value=str;
this.exportDataObject("theFile.xml");

@+

 

View solution in original post

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 ,
Oct 27, 2022 Oct 27, 2022

Hi,

Try this attached file and the action wizard included (not possible to save the xml file from the button).

Script:

var spans=this.getField("text1").richValue;
var str=util.spansToXML(spans);
this.createDataObject("theFile.xml",str);
var spans=util.xmlToSpans(str);
this.getField("text2").richValue=spans;
this.getField("text3").value=str;
this.exportDataObject("theFile.xml");

@+

 

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 Beginner ,
Oct 27, 2022 Oct 27, 2022

woow, thanks mate

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 Beginner ,
Nov 02, 2022 Nov 02, 2022

is there anyway to export a file?

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 02, 2022 Nov 02, 2022
LATEST

What do you mean?

If you use the action wizard you can export the xml file. This can also be made via a button if we write an application script.

@+

 

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