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

Document Generation: Tagger converting values

Explorer ,
Apr 05, 2022 Apr 05, 2022

Copy link to clipboard

Copied

Is there a way to convert a data value from what's in the incoming JSON to another value.  I've got a UI that has radio buttons on it.   The JSON submission looks like:

{

"exportUSA""1"
}
 
but I don't want to put the value of 1 into the document.  I want to convert it to Yes or No.   I didn't see anything in the Advance tab of the Document Generation Tagger.   Is there a way to do this?
 
 

Views

296

Translate

Translate

Report

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

correct answers 1 Correct answer

Engaged , Apr 07, 2022 Apr 07, 2022

Remember that the Tagger helps you design your document, but isn't actually used in a production application. You'll be using your Word template, your data, and calls to the API (normally via the SDK). 

Before you call the API, you can manipulate your data as you see fit. So if you got that data above from a database, you would simply use code to change the 1 to Yes, and 0 to No. 

In other words - get your data as you normally would - modify the data - call the API.

Votes

Translate

Translate
Engaged ,
Apr 07, 2022 Apr 07, 2022

Copy link to clipboard

Copied

Remember that the Tagger helps you design your document, but isn't actually used in a production application. You'll be using your Word template, your data, and calls to the API (normally via the SDK). 

Before you call the API, you can manipulate your data as you see fit. So if you got that data above from a database, you would simply use code to change the 1 to Yes, and 0 to No. 

In other words - get your data as you normally would - modify the data - call the API.

Votes

Translate

Translate

Report

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
Explorer ,
Apr 08, 2022 Apr 08, 2022

Copy link to clipboard

Copied

I was hoping not to add a data manipulation step and instead handle it in the Word template, but fair enough.  Thanks for the response.

Votes

Translate

Translate

Report

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
Adobe Employee ,
Apr 09, 2022 Apr 09, 2022

Copy link to clipboard

Copied

LATEST

One thing to keep in mind (and note, I'm cfjedimaster, I must have logged in with my nonwork user), is that template languages in general draw a line between how much can be done in the language and how much should be done in code. Handlebars, for example, is very strict. If I remember right, you can't do stuff like, "if name == ray" but must instead ensure you've got booleans setup ("if ray"). The idea being that Handlebars doesn't want you building complex templates. 

 

This is all philosophical, but I thought I'd share. 🙂 I prefer Liquid which lets you do quite a bit, but even it has it's limits. 

Votes

Translate

Translate

Report

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
Resources