I'm trying to check if a value (which comes from a Variable) exists in a SP List.
I tried this, and returned true (I don't know if I used the correct syntax, but it worked!):
If(!IsBlank(LookUp('SPList', Variable = Column,"*"&Variable&"*"))
Now I'm trying to count rows if contains the Variable, but returns 0:
CountRows(Filter('SPList', Column = "*"&Variable&"*"))
How can I workaround that?
Solved! Go to Solution.
For the first formula, you can use the following a little more easily:
If(!LookUp('SPList', Variable = Column,"*" & Variable & "*", true), ... )
In this case, LookUp will return true if the record exists.
Since CountRows is not delegable, it seems to sometimes ignore itself.
Try the following for your second formula:
With({_data: Filter('SPList', Column = "*" & Variable & "*")}
CountRows(_data)
)
I hope this is helpful for you.
Hi, what you have should work, are you trying to use wild cards though? e.g. "*"? does you data actual contain * e.g. "*MyValue*"
the below works for me but this will return a number so you would need to put it in a text property to view it
CountRows(Filter('SPList', Column = Variable))
For the first formula, you can use the following a little more easily:
If(!LookUp('SPList', Variable = Column,"*" & Variable & "*", true), ... )
In this case, LookUp will return true if the record exists.
Since CountRows is not delegable, it seems to sometimes ignore itself.
Try the following for your second formula:
With({_data: Filter('SPList', Column = "*" & Variable & "*")}
CountRows(_data)
)
I hope this is helpful for you.
Just to add to @RandyHayes, i think you missed a comma,
With({_data: Filter('SPList', Column = "*" & Variable & "*")},
CountRows(_data)
)
Yes, thank you...missed a comma. Not unusual when typing in formulas freehand.
User | Count |
---|---|
256 | |
108 | |
97 | |
51 | |
39 |