Hi Arlene,
I am sorry, but I am not understanding well - I am beginner in RPA. :)
I will describe the issue.
I want to use variable in VBS script (to work in SAP). The part of the script is this:
session.findById("wnd[0]").sendVKey 0
session.findById("wnd[0]/usr/radX_AISEL").select
session.findById("wnd[0]/usr/ctxtSD_SAKNR-LOW").text = "${CurrentItem}[0]"
session.findById("wnd[0]/usr/ctxtSD_BUKRS-LOW").text = "JCZ"
session.findById("wnd[0]/usr/ctxtSO_BUDAT-LOW").text = "1.1.2025"
session.findById("wnd[0]/usr/ctxtSO_BUDAT-HIGH").text = "15.1.2025"
This script is in loop and the data are from Excel - for each Excel row run the script (each Excel row = CurrentItem)
So I want use this variable from loop:
${CurrentItem}[0]
But I get this error: The untypect object argument to the Text function has an incorrect type. Expected: Text, Actual: Text.
So I think, I have to convert this variable to Text.
This is the window for set variable (as you wrote I should use):

Here to the value field should I write this?
string(items('Apply_to_each')?['YourFieldName'])
Next question - in another older flow, I have again the loop with Excel rows. I get CurrentItem variable. But it works well in next actions (in this case for naming of files or folders) Why?
The variable isn´t with $, but is described like this: %CurrentItem[4]%
Why is there the difference and what does it mean?
Thank you
Jana