Yes/No column value to be true/false

Hi,

For a JSON put request i need the yes/no column to be true/false. I know that the backend value in google sheets is true/false but appsheet uses Y/N. Is there a way to force this? Ofcourse i can fall back on a EnumType. But i like the switch buttons on the Quick edit columns option.

-Remco

Solved Solved
0 10 2,884
1 ACCEPTED SOLUTION

THE SOLUTION: โ€œtrueโ€ and โ€œfalseโ€ in the IF statement with the " ". I think appsheets sends the true and false with Y /N. So we came back on the orignial problem

With big help from @LeventK!

{
  "PtProject": {
    "Element": {
      "Fields": {
        "PrId": "<<[Projectcode]>>",
        "U47E045AF46C52C9490047C8376873EF6": "<<IF([Plattegrond__check_]='Y',"TRUE","FALSE")>>"
      }
    }
  }
}

View solution in original post

10 REPLIES 10

@Remco_Edelenbos
Y/N column values are also passes as true/false in a JSON body. Only in appโ€™s UX views you see them as Y/N. But I believe you want to change the button appearance or button text as true/false, am I correct?

Hi @LeventK,

As far as i can tell Appsheet does make a Y, based on this message below.

Sorry @Remco_Edelenbos itโ€™s my badโ€ฆThe toggle button (Y/N type column in Detail View appears as a toggle button) records it as TRUE/FALSE

Yes, in my google sheet is records as a true/false but. As you can see in my screenshot above, Appsheet record it as Y/N. you can also see it in the table behind the message.

@Remco_Edelenbos
In a JSON body;

{
	"SomeKey": "<<[Your_YN_Column_Name]>>"
}

when evaluated, SomeKey parameter shall take a Boolean value of TRUE/FALSE no matter what display value you are seeing inside the AppSheet app. Can you please post or take a screenshot of your JSON body?

This is my body:

{
  "PtProject": {
    "Element": {
      "Fields": {
        "U47E045AF46C52C9490047C8376873EF6": <<[Plattegrond__check_]>>,
        "UF85A116A4D0561FF34F7D91081CC0C00": <<[Accreditatie__check_]>>,
        "UC98BD5A847712AC3AEE03A8D3176AADF": <<[All_check]>>
      }
    }
  }
}

@Remco_Edelenbos
Your JSON is unfortunatey malformed. Check this out and notice that your AppSheet placeholders are wrapped with double quotes:

{
  "PtProject": {
    "Element": {
      "Fields": {
        "U47E045AF46C52C9490047C8376873EF6": "<<[Plattegrond__check_]>>",
        "UF85A116A4D0561FF34F7D91081CC0C00": "<<[Accreditatie__check_]>>",
        "UC98BD5A847712AC3AEE03A8D3176AADF": "<<[All_check]>>"
      }
    }
  }
}

Provided it still produces the same result, try with this one intead:

{
  "PtProject": {
    "Element": {
      "Fields": {
        "U47E045AF46C52C9490047C8376873EF6": "<<IF([Plattegrond__check_]='Y',TRUE,FALSE)>>",
        "UF85A116A4D0561FF34F7D91081CC0C00": "<<IF([Accreditatie__check_]='Y',TRUE,FALSE)>>",
        "UC98BD5A847712AC3AEE03A8D3176AADF": "<<IF([All_check]='Y',TRUE,FALSE)>>"
      }
    }
  }
}

Hi @LeventK,

Iโ€™m trying, but i donโ€™t get it to workโ€ฆ with this JSON:

{
  "PtProject": {
    "Element": {
      "Fields": {
        "PrId": "<<Projectcode>>",
        "U47E045AF46C52C9490047C8376873EF6": "<<IF([Plattegrond__check_]="Y",true,false)>>"
     }
    }
  }
}

2X_3_34985c0932818824a999bbe5809f87eb7617824e.png

But when i put my JSON like this it works:

{
  "PtProject": {
    "Element": {
      "Fields": {
        "PrId": "<<Projectcode>>",
        "U47E045AF46C52C9490047C8376873EF6": "true" //with and without the ""
     }
    }
  }
}

ARGGG

@Remco_Edelenbos
May I encourage you to try with this one?

{
  "PtProject": {
    "Element": {
      "Fields": {
        "U47E045AF46C52C9490047C8376873EF6": "<<IF([Plattegrond__check_]='Y',TRUE,FALSE)>>",
        "UF85A116A4D0561FF34F7D91081CC0C00": "<<IF([Accreditatie__check_]='Y',TRUE,FALSE)>>",
        "UC98BD5A847712AC3AEE03A8D3176AADF": "<<IF([All_check]='Y',TRUE,FALSE)>>"
      }
    }
  }
}

THE SOLUTION: โ€œtrueโ€ and โ€œfalseโ€ in the IF statement with the " ". I think appsheets sends the true and false with Y /N. So we came back on the orignial problem

With big help from @LeventK!

{
  "PtProject": {
    "Element": {
      "Fields": {
        "PrId": "<<[Projectcode]>>",
        "U47E045AF46C52C9490047C8376873EF6": "<<IF([Plattegrond__check_]='Y',"TRUE","FALSE")>>"
      }
    }
  }
}
Top Labels in this Space