Unable to serch database with cookie value

Hello I am using this cookie to build a referral program. This is a test section i ve built. Smukti Referral Program The cookie reads, writes and display in text fields correctly. However when I use the cookie value in a workflow to “Do a search For” or when i use it to display in an email is returns blank. I ve been this issue for over a day and unable to fix. What am i missing? It is important this works coz I am using the cookie value(referralcode) to read the database to check the referrer.

@andy.i any help is much appreciated :palms_up_together:

There was a delay in fetching values. I ve used TIny cookies with custom states solved the issue.