Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Bug: Invalid formula IF ... == TRUE() or FALSE() #7399

Closed
1 task done
Sunatley opened this issue Jan 10, 2024 · 2 comments
Closed
1 task done

🐛 Bug: Invalid formula IF ... == TRUE() or FALSE() #7399

Sunatley opened this issue Jan 10, 2024 · 2 comments
Assignees
Labels
Status: Reproducible Able to reproduce the issue based on the reporters' guideline.
Milestone

Comments

@Sunatley
Copy link

Sunatley commented Jan 10, 2024

Please confirm if bug report does NOT exists already ?

  • I confirm there is no existing issue for this

Steps to reproduce ?

  1. I created the "Test" field with the bool type
  2. Created the "Formula" field with the formula type:
    IF({Test} == TRUE(), "Yes", "No")
    or
    IF({Test} == FALSE(), "No", "Yes")
  3. I got an error: Invalid formula

Desired Behavior

I want to check for True/False and return a specific value

Project Details

Node: v18.5.0
Arch: x64
Platform: linux
Docker: false
RootDB: pg
PackageVersion: 0.203.2

Attachments

No response

@Sunatley Sunatley changed the title 🐛 Bug: Invalid formula IF ... == TRUE() 🐛 Bug: Invalid formula IF ... == TRUE() or FALSE() Jan 10, 2024
@dstala dstala added the Status: Reproducible Able to reproduce the issue based on the reporters' guideline. label Jan 11, 2024
@dstala dstala added this to the vNext milestone Jan 11, 2024
@dstala
Copy link
Member

dstala commented Jan 11, 2024

error: select CASE 
	WHEN (CASE WHEN "title7" = 1 THEN true ELSE false END ) THEN 'Yes'
	ELSE 'No'
 END as "__dry_run_alias" from "nc_t7gh___Features" - operator does not exist: boolean = integer
    at Parser.parseErrorMessage (/Users/rajuudava/NocoDB/nocohub/node_modules/.pnpm/pg-protocol@1.6.0/node_modules/pg-protocol/src/parser.ts:369:69)
    at Parser.handlePacket (/Users/rajuudava/NocoDB/nocohub/node_modules/.pnpm/pg-protocol@1.6.0/node_modules/pg-protocol/src/parser.ts:188:21)
    at Parser.parse (/Users/rajuudava/NocoDB/nocohub/node_modules/.pnpm/pg-protocol@1.6.0/node_modules/pg-protocol/src/parser.ts:103:30)
    at Socket.<anonymous> (/Users/rajuudava/NocoDB/nocohub/node_modules/.pnpm/pg-protocol@1.6.0/node_modules/pg-protocol/src/index.ts:7:48)
    at Socket.emit (node:events:513:28)
    at Socket.emit (node:domain:489:12)
    at addChunk (node:internal/streams/readable:324:12)
    at readableAddChunk (node:internal/streams/readable:297:9)
    at Socket.Readable.push (node:internal/streams/readable:234:10)
    at TCP.onStreamRead (node:internal/stream_base_commons:190:23) {
  length: 202,
  severity: 'ERROR',
  code: '42883',
  detail: undefined,
  hint: 'No operator matches the given name and argument types. You might need to add explicit type casts.',
  position: '40',
  internalPosition: undefined,
  internalQuery: undefined,
  where: undefined,
  schema: undefined,
  table: undefined,
  column: undefined,
  dataType: undefined,
  constraint: undefined,
  file: 'parse_oper.c',
  line: '647',
  routine: 'op_error'
}
Error: Formula error: select CASE 
	WHEN (CASE WHEN "title7" = 1 THEN true ELSE false END ) THEN 'Yes'
	ELSE 'No'
 END as "__dry_run_alias" from "nc_t7gh___Features" - operator does not exist: boolean = integer
    at formulaQueryBuilderv2 (/Users/rajuudava/NocoDB/nocohub/packages/nocodb/src/db/formulav2/formulaQueryBuilderv2.ts:1179:11)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async ColumnsService.columnAdd (/Users/rajuudava/NocoDB/nocohub/packages/nocodb/src/services/columns.service.ts:1699:11)
    at async ColumnsController.columnAdd (/Users/rajuudava/NocoDB/nocohub/packages/nocodb/src/controllers/columns.controller.ts:37:12)

@mertmit mertmit mentioned this issue Jan 15, 2024
9 tasks
@dstala
Copy link
Member

dstala commented Jan 17, 2024

Fixed; should be available in next release

@dstala dstala closed this as completed Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Reproducible Able to reproduce the issue based on the reporters' guideline.
Projects
Status: ✅ Closed
Development

No branches or pull requests

3 participants