1

I have a JSON a object named Task with a set of properties. I also have a string: var customId = Custom_x005f_f3e0e66125c74ee785e8ec6965446416". I would like to get the value Task.Custom_x005f_f3e0e66125c74ee785e8ec6965446416 using my string variable.

Would you know how to do that ?

Please let me know if I'm not clear enough. Thanks.

Regards,

a1mery
  • 271
  • 1
  • 3
  • 13

2 Answers2

3

Just use this:

var string = "Custom_x005f_f3e0e66125c74ee785e8ec6965446416";
vr myVar = Task[string];// Task.Custom_x005f_f3e0e66125c74ee785e8ec6965446416
0

You can use the bracket notation:

var customId = "Custom_x005f_f3e0e66125c74ee785e8ec6965446416";
var value = Task[customId];
tjespe
  • 704
  • 7
  • 17