Empleo correcto de variable

Buen día comunidad, tengo el siguiente código: “JSON_ResponseApi(“StartDate”)(“day”).ToString()” pero me aparece el error bc30198. Me pueden por favor ayudar en como poder resolverlo para ser colocado como variable

Hi @Renzo

Please try the below syntax:

startDateDay= JSON_ResponseApi("StartDate")("day").ToString()

startDateDay is of DataType System.String
JSON_ResponseApi is of DataType Newtonsoft.Json.Linq.JObject
Regards

Thank you for that. Can you help me with something else pls?

BC30198 is error id for ’ )’ expected

Can you share screenshot of your expression?

Or re-input expression may solve this matter.

Regards,


Hi, I want to save that variable as string.

What I’m doing is extracting information from a internet page as date, month and year, and I want to add that information extracted as day and put it on a calendar, to click on the number that was extracted. Can you help me with that? I was using the option click but I don’t know if it’s the correct one.

Hi @Renzo

Yeah I will try to help you out please let me know the issue.

Regards

Hi,

For now, can you try to remove surrounded double quote?

JSON_ResponseApi("StartDate")("day").ToString()

However, in general, it’s necessary to define in not variable panel but assign activity as the following.

image

Regards,

Hi @Renzo

Can you try to create a variable and assign to it

day= JSON_ResponseApi(“StartDate”)(“day”).ToString()

Cheers!!

I am learning on how to use UiPath, and I have a VB Code that I want to use on a calendar searching for an exact year, but the problem with this calendar is that when I select the years, are limited to show only 20 years, and if I want to change the year, i need to click in an other area. So I wrote a VB Code that I want to use with the tool of extract VBScript, in order to this step be done, but I don’t know how to do it exactly…
This is the code:
anyoSel = 2002
finalizar = “N”

WHILE ( finalizar = "N" ) :

	htmlCombobox = Extrar el InnerHTML / outerHTML del Combobox Anyo

	finalizar = Ejecutar VBSCRIPT :


		Function validaOpcionAnyo( htmlCombobox as String, anyoSel as Integer ) ] :

			Dim posPrimeraOpcion As Integer
		    Dim posMayor As Integer
		    Dim posMenor As Integer
		    Dim opcioninicial as String
		    Dim opcionIniInt as Integer
		    Dim delta as Integer

		    ' Calcula la primera opcion del combobox
		    posPrimeraOpcion = InStr(htmlCombobox, "<option")
		    posMayor = Instr(posPrimeraOpcion, htmlCombobox, ">")
		    posMenor = Instr(posMayor, htmlCombobox, "<")
		    opcionInicial = Mid(htmlCombobox, posMayor+1, posMenor-posMayor-1)

			opcionIniInt = Cint(opcionInicial)
			delta = anyoSel - opcionIniInt

			IF delta < 0 :
				validaOpcionAnyo = "N"

			ELSE:
				validaOpcionAnyo = "S"

	IF finalizar = "N":
		Seleccionar primera opcion del combobox

	ELSE:
		Hacer comboBoxAnyo = anyoSel
		finalizar = "S"

@Yoichi could you please help me with something else?
I am learning on how to use UiPath, and I have a VB Code that I want to use on a calendar searching for an exact year, but the problem with this calendar is that when I select the years, are limited to show only 20 years, and if I want to change the year, i need to click in an other area. So I wrote a VB Code that I want to use with the tool of extract VBScript, in order to this step be done, but I don’t know how to do it exactly…
This is the code:
anyoSel = 2002
finalizar = “N”

WHILE ( finalizar = "N" ) :

	htmlCombobox = Extrar el InnerHTML / outerHTML del Combobox Anyo

	finalizar = Ejecutar VBSCRIPT :


		Function validaOpcionAnyo( htmlCombobox as String, anyoSel as Integer ) ] :

			Dim posPrimeraOpcion As Integer
		    Dim posMayor As Integer
		    Dim posMenor As Integer
		    Dim opcioninicial as String
		    Dim opcionIniInt as Integer
		    Dim delta as Integer

		    ' Calcula la primera opcion del combobox
		    posPrimeraOpcion = InStr(htmlCombobox, "<option")
		    posMayor = Instr(posPrimeraOpcion, htmlCombobox, ">")
		    posMenor = Instr(posMayor, htmlCombobox, "<")
		    opcionInicial = Mid(htmlCombobox, posMayor+1, posMenor-posMayor-1)

			opcionIniInt = Cint(opcionInicial)
			delta = anyoSel - opcionIniInt

			IF delta < 0 :
				validaOpcionAnyo = "N"

			ELSE:
				validaOpcionAnyo = "S"

	IF finalizar = "N":
		Seleccionar primera opcion del combobox

	ELSE:
		Hacer comboBoxAnyo = anyoSel
		finalizar = "S"