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

Show Specific Stamp Based on Another Field's Value

New Here ,
Oct 09, 2023 Oct 09, 2023

Copy link to clipboard

Copied

I have looked for an answer to this problem for a few weeks and seem to find part of the answer, but haven't been able to put it all together.  

 

I am using: 

Amy32812163fx52_0-1696882905592.png

 

I am creating a fillable form where individuals will fill in the % for their metric into the Results field and that field will check the Targets fields to determine which stamp will show in the Score field.  For example, the Target is >89% so, if 95% is entered into the Results field, the Green stamp should show in the Score field, if 85% is entered in the Results field, the Yellow stamp should show in the Score field, etc.  

 

I have 6 different teams and each team has 1-6 metrics to report out on.

 

Target fields (currently named - "team.color.field iteration") - 

Amy32812163fx52_1-1696882961639.png

 

Results field (currently named - "team.results.field iteration") - 

Amy32812163fx52_2-1696883109718.png

 

Stamps (named Green, Yellow, Red) - 

Amy32812163fx52_4-1696883145892.png

 

 

TOPICS
Create PDFs , How to , JavaScript , PDF , PDF forms

Views

208

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
Community Expert ,
Oct 09, 2023 Oct 09, 2023

Copy link to clipboard

Copied

Instead of stamps use image fields with those icons already pre-selected as the field's icon. It will be much easier to show the correct field (and hide the others), than to use stamps for this.

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
New Here ,
Oct 09, 2023 Oct 09, 2023

Copy link to clipboard

Copied

So, would I have 3 image fields on top of each other?  There is only one score field and 3 images.  I have a total of 30 rows that have a results field & score field.  Each of those results fields will be validated against a different set of target fields.  I originally started with an image field, but couldn't find the right script to show or hide the needed image based on what is entered in the results field.  Basically, I need the script to take what is entered in the results field (on page 2 of the document), compare it to the target fields (on page 27 of the document) to determine which image should show in the score field (on page 2 of the document).  

 

I'm quite sure I am over thinking it and it is much simpler than I am trying to do.  

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
Community Expert ,
Oct 09, 2023 Oct 09, 2023

Copy link to clipboard

Copied

Either that, or use (hidden) image fields with the images you want to use, and then copy them over to a single field for each result, yes. That approach requires a bit more complicated script, but will cut the number of fields you need to create by 66% (1 instead of 3 for each outcome). If you chose the latter option you would also need to create a (single) "blank" image field, for when you don't want to display anything.

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
Community Expert ,
Oct 09, 2023 Oct 09, 2023

Copy link to clipboard

Copied

LATEST

As for the code, here's the basic code to show/hide the fields in your original screenshot (to be used as the custom Validation or Calculation script of the results field):

 

this.getField("IMP.red.1").display = (event.value<80) ? display.visible : display.hidden;
this.getField("IMP.yellow.1").display = (event.value>80 && event.value<=89) ? display.visible : display.hidden;
this.getField("IMP.green.1").display = (event.value>89) ? display.visible : display.hidden;

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