Formula - problem - "if expects parameter..."

Hi.

I am trying to finish a IF statement, but I am getting an error in the “false” section. The error:

“If expects parameter condition to be a value, but found (‘’), wich is a table”. My goal is: when is false, to show a simpe message.

I tried differents types of information to insert, but always getting this problem. See the full IF statement below. I f I try a simple IF statement, it works, but not with this formula:

if(
Timesheet
.Filter(
And([User WR] = User(), Setup = 1)
.First()
),
Concatenate(
User().Name, LineBreak(),
"You are currenctly clocked in on: ", LineBreak(),
FormulaMap(
Timesheet
.Filter(
And(
[User WR].Contains(User()), Setup = 1
)
),
Job.[Job Name]
),
" for ",
FormulaMap(
Timesheet
.Filter(
And(
[User WR].Contains(User()), Setup = 1
)
),
[Time Spent]
)
),“test”)

The “true” part is working. I tried inserting only “False()” - nothing.

Hi @Elber_Domingos :blush: ,

You might be missing a condition in the first part of your If()

This is just a Filter() formula that might or might not return a row from your table Timesheet, nothing more :blush:

But for the If() to work you need to compare that potential row to something which creates the condition for the If() to return either true or false and do what it needs to do :blush:

Timesheet.Filter(
   [User WR] = User() AND Setup = 1
 ).First() [missing condition should go here]

Depending on what you’re trying to do exactly, the condition you need could be written in different ways so I’m just going to shoot in the dark here and say that something like

If(
Timesheet.Filter(
     [User WR] = User() AND Setup = 1
   ).First().Count() = 1,
  what to do if true,
  what to do if false
)

… might help you here :blush: (but without more info about your setup, it’s just a vague guess :innocent: )

I hope this helps though :innocent:

1 Like

Perfect - it worked. Thank you so much

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.