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

How to use string variables in datatable in if statement? - user found solution #874

Closed
gem3 opened this issue Oct 7, 2020 · 8 comments
Closed
Labels

Comments

@gem3
Copy link

gem3 commented Oct 7, 2020

Hello,

I'm trying to use variables in datatable in if-statement.

Ex."size" in datatable.('S'=small, 'L'=large )

What I want to do is

if size equals to "S"
	echo This is SMALL
else
	echo This is LARGE

I have tried various ways, but not worked.

If anyone know solutions, please share your solutions.

Thank you.

@gem3
Copy link
Author

gem3 commented Oct 8, 2020

Hello,

After checking a log of js file. I found a solution.

if "`size`" equals to "S"
	echo This is SMALL
else
	echo This is LARGE

I hope this help somebody in future.

kensoh, My prayers with you and family.

@gem3 gem3 closed this as completed Oct 10, 2020
@sheneeb
Copy link

sheneeb commented Oct 14, 2020

Thank you for that gem3

@kensoh
Copy link
Member

kensoh commented Nov 23, 2020

Thank you @gem3... Sorry I was away the past few months - tebelorg/RPA-Python#144

Yes that's the syntax for comparing a variable as a string in conditions.

@kensoh kensoh added the query label Nov 23, 2020
@kensoh kensoh changed the title How to use variables in datatable in if-statement? How to use string variables in datatable in if-statement? Nov 23, 2020
@kensoh kensoh changed the title How to use string variables in datatable in if-statement? How to use string variables in datatable in if-statement? - user found solution Nov 23, 2020
@kensoh
Copy link
Member

kensoh commented Nov 26, 2020

Adding on, you can use double or single quotes in TagUI -

size = 'S'
  
if '`size`' equals to 'S'
    echo This is SMALL
else
    echo This is LARGE

I personally prefer single quote because I don't need to press shift key each time I type the quote. This tiny time-saving each time a quote is typed will be compounded info significant time savings over a long period of time.

@gem3
Copy link
Author

gem3 commented Nov 26, 2020

Helloo kensoh,

I have to press shift key to type double or single quotes with a keybord in my language.
this is a keybord layout problem with my language.

btw are you ok now?
I don't know whole your story, but I'm glad to know you are back.

@kensoh
Copy link
Member

kensoh commented Nov 27, 2020

Oh I see.. Then there is no difference using double or single quotes, I understand now...

Thank you..... My mum has just been discharged to go home, after 6 months in hospital. Condition is still bad but we are trying to do what we can to help her recover and not be dependent on oxygen supply through a hole in her throat. It looks like going to be a long journey ahead.

Plan to send 18-month old baby to childcare failed. On first day got a couple of accidents already. Now trying to hire a helper to help with housework, cooking and taking care of baby. So that I can start work again. It's tough being sandwiched with the demands of taking care of a young baby and my mum's illness. But there's no other option than facing it and marching on.

@kensoh kensoh changed the title How to use string variables in datatable in if-statement? - user found solution How to use string variables in datatable in if statement? - user found solution Nov 27, 2020
@gem3
Copy link
Author

gem3 commented Nov 27, 2020

Hello kensoh,

It's hard to find words for you.
But I like the story of "塞翁失马,焉知非福".

"There is no unstoppable rain."

@kensoh
Copy link
Member

kensoh commented Nov 28, 2020

Thank you @gem3 I appreciate your kind words of encouragement in these dark times 🤞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants