You are viewing limited content. For full access, please sign in.

Question

Question

check box values in fill pdf Text field

asked on February 10, 2021

Hello, 

I have a Fillable PD that has a section where staff enters pre-established text (technical standards).

To avoid having staff type it every time they need to generate this PDF, I created a form that has all the possible options as checkboxes (they can have more than one). 

The problem is that if I use the general Variable name %(RetrieveBusinessProcessVariables_ContractTechnicalStandards), I get only the first option selected. And, I get the Values (with the underscores). 

If do this instead:

I'll obtain the words True, False, False, True, False. 

 

This made me think I could use the Token Calculator to create a new Token where based on the True/False results would return the text I want. So I wrote this:

IF(%(RetrieveBusinessProcessVariables_ContractTechnicalStandards_P_327_Conservation_Cover_Is Set),327 Conservation Cover, IF(%(RetrieveBusinessProcessVariables_ContractTechnicalStandards_P_342_Critical_Area_Seeding_Is Set), 342 Critical Area Seeding, IF(%(RetrieveBusinessProcessVariables_ContractTechnicalStandards_P_382_Fence_Is Set), 382 Fence,IF(%(RetrieveBusinessProcessVariables_ContractTechnicalStandards_P_512_Forage_and_Biomass_Is Set), 512 Forage and Biomass, IF(%(RetrieveBusinessProcessVariables_ContractTechnicalStandards_P_516_Watering_Facilities_Is Set), 516 Watering Facilities, "")))))

 

But no matter what I do the Test Formula says it's an invalid expression. I've tried to use just one condition to work on my syntax (I'm new to Laserfiche), but I still can't make it to work. 

I've also tried: IF(%(RetrieveBusinessProcessVariables_ContractTechnicalStandards_P_327_Conservation_Cover_Is Set),TEXT(327 Conservation Cover),TEXT()) because I read the double quotes are a special character, but I can't seem to test the formula correctly. 

I would like my result on the PDF to be:

    327 Conservation Cover

    512 Forage and Biomass

(If these were the options checked in the form be the planner)

 

Do I need to use the Token Calculator? Can I resolve this in the Fill Out PDF Form activity?

 

Here's my workflow (the Token calculator is not working)

 

Any ideas, suggestions, etc, are welcome. Thank you!

 

1 0

Answer

SELECTED ANSWER
replied on February 10, 2021

Yeah, the way you had the nested IF statements initially would only return the first true value.

You could use Concatenation - which means to combine strings.

In the token calculator, concatenation is done with the & symbol.

IF(%(RetrieveBusinessProcessVariables_ContractTechnicalStandards_P_327_Conservation_Cover_Is Set),"327 Conservation Cover ","") & IF(%(RetrieveBusinessProcessVariables_ContractTechnicalStandards_P_342_Critical_Area_Seeding_Is Set), "342 Critical Area Seeding ","")

I added a space to the end of each of the strings, so that it always ends in a space, which results in multiple values being separated by a space.

"A " & "B " & "C " = "A B C "

2 0

Replies

replied on February 10, 2021

Can you try this?

IF(%(RetrieveBusinessProcessVariables_ContractTechnicalStandards_P_327_Conservation_Cover_Is Set),"327 Conservation Cover","")

When you are doing a string value in the formulas you need to surround them with quotes.

Like this: "327 Conservation Cover" instead of just 327 Conservation Cover

TEXT() is mostly for converting numbers and other values to text, thus TEXT(327.5) becomes the string: "327.5"

TEXT(327 Conservation Cover) won't work, because it has no idea that 327 Conservation Cover is supposed to be a string and doesn't know what it is.  You could actually say TEXT("327 Conservation Cover"), but that would be functionaly identical to just saying "327 Conservation Cover".

3 0
replied on February 10, 2021

Thank you, Matthew!

 

So, this worked! Funny, because that was how I started! I used quotes from the get go. 

Now, I need to figure out my nested IFs because if the first one is true it will never get to the following ones because it has met the True condition.

Should I be using a multivalue token then? And then use it in the PDF fill option?

 

0 0
SELECTED ANSWER
replied on February 10, 2021

Yeah, the way you had the nested IF statements initially would only return the first true value.

You could use Concatenation - which means to combine strings.

In the token calculator, concatenation is done with the & symbol.

IF(%(RetrieveBusinessProcessVariables_ContractTechnicalStandards_P_327_Conservation_Cover_Is Set),"327 Conservation Cover ","") & IF(%(RetrieveBusinessProcessVariables_ContractTechnicalStandards_P_342_Critical_Area_Seeding_Is Set), "342 Critical Area Seeding ","")

I added a space to the end of each of the strings, so that it always ends in a space, which results in multiple values being separated by a space.

"A " & "B " & "C " = "A B C "

2 0
replied on February 11, 2021

Matthew, not sure how to thank you, but, Thank you!!!!!! Sometimes the simplest solutions are the best ones!

 

Have a great day!

1 0
replied on February 11, 2021

Saying "Thank you" and marking the question as answered is more than enough.  I'm very happy to help, and very happy it worked for you. smiley

1 0
replied on February 11, 2021

Thank you for that too. This was my first time posting a question and I hadn't realized I had to mark it as answered. Always learning! :) 

1 0
You are not allowed to follow up in this post.

Sign in to reply to this post.