Less than / Greater than (Parse) Keycheck Block
I have my parse (string) REWARDS
For next block it’s Keycheck and CUSTOM.
I want everything that’s below 50 to go to free but not sure which to use Int or FLOAT
And I tried this but does not work.
It still gives success on a $15 account.
How it looks right now in Loli
BLOCK:Parse
LABEL:REWARDS
input = @data.SOURCE
leftDelim = "loyaltyRewards\":[{\"amount\":"
rightDelim = ","
jToken = ".loyaltyRewards"
MODE:LR
=> CAP @REWARDS
ENDBLOCK
BLOCK:Keycheck
KEYCHAIN CUSTOM AND
STRINGKEY @data.SOURCE Contains "loyaltyRewards\":[]"
STRINGKEY @data.SOURCE Contains "totalAvailableRewards\":0"
INTKEY @REWARDS EqualTo 50
ENDBLOCK
jrem
October 12, 2021, 11:20am
2
I may be wrong but pretty sure you would need to convert the string to a int
Just create a new constant integer varible and set it as the capture.
C# doesnt play well mixing Strings and Integers so best to convert it outright
Ruri
October 12, 2021, 12:21pm
3
Why are you using EqualTo if you want to use LessThan and GreaterThan instead? I don’t understand…
beyto
October 12, 2021, 12:21pm
4
is it something like this
if ( @ REWARDS >= "50")
{
data.STATUS = "CUSTOM";
}
Ruri
October 12, 2021, 12:22pm
5
That will definitely not work @beyto you’re using >= with a string
beyto
October 12, 2021, 12:31pm
6
Yes that is right @Ruri
This worked for me before on string value.
if ( @price == " " || @price == $"0{currency}")
{
data.STATUS = "CUSTOM";
}
but this doesn’t work >=
Ruri
October 12, 2021, 12:36pm
7
It’s better if he sticks to using the keycheck block as it was built especially for this exact purpose
1 Like
it was 3am when i posted this but yes i was trying to use Less than 50
Ruri
October 12, 2021, 2:19pm
9
What’s a sample value of the variable called REWARDS?
BLOCK:Parse
LABEL:REWARDS
input = @data.SOURCE
leftDelim = “loyaltyRewards”:[{“amount”:"
rightDelim = “,”
jToken = “.loyaltyRewards”
MODE:LR
=> CAP @REWARDS
ENDBLOCK
BLOCK:Keycheck
banIfNoMatch = False
KEYCHAIN CUSTOM AND
STRINGKEY @data.SOURCE Contains “loyaltyRewards”: "
STRINGKEY @data.SOURCE Contains “totalAvailableRewards”:0"
INTKEY @REWARDS LessThan 50
ENDBLOCK
Tried this and still get success when it should be custom
beyto
October 12, 2021, 5:40pm
11
@bestlifeoncod
I think your answer is here
ya no clue what that even means but ok.
beyto
October 12, 2021, 8:34pm
13
I think it’s telling you to write the content you get from here
loyaltyRewards":[{"amount":"**what exactly is written here**,
no worries ill just do it manually and check on ob2 then recheck the hits on ob. Because the Int and Float shit is giving me a headache.
It would be really easier to help you if you screenshot your PARSE and KEY CHECK block in stacker.
And add an example of what you are tryna capture please.
Ex: totalreward:“57”,
I want to capture 57