Need help with syntax to pass two parameters to a method using runIn

Back for more, I'm giving up after 30 minutes of searching now. What I see in the doc example for runIn makes no sense to me.
runIn(50, "myMethod", [data: [myKey:"myValue"]])

I need to run a method using runIn and pass it two string parms.
void DoSomething(String parm1, String parm2)

I want to pass parm1 as a string "literal" and parm2 as string variable named Path, like I do from other methods, for example: DoSomething("This", Path)

How to I code that call using runIn?

I can't ask Bing Ai this question. I need some real smarts! :slight_smile:

a snippet might help?

void setStatus(cd) {
	def pData = [data:['cd':[cd.deviceNetworkId]]]
	runInMillis( 1600, settingsAccumWait, pData )
}

void settingsAccumWait(data) {
	def cdd = data["cd"]
	def cd = getChildDevice(cdd)

I'm passing the unique child device (cd) in this snippet. It looks to me that you have some punctuation adjustments to make. Otherwise, you've got it. :slight_smile:

So with this, I'm thinking I would need to modify my other calls to pass a map if parms, instead of ** ("This",Path)**. That's how I'm interpreting the example, too. I have to pass a map. So I may skip this and simply runIn a method that has no parms, which then calls the method I want to run with the parms. Easy enough since there's not a lot to do.

You can also make multiple definitions of the same function. So you could have one defined to take the map, which then calls the main function using the individual parameters.

Here is an example where I have done multiple function definitions

//Handle when missing parameters
List<String> setLED(ledNumber) { setLED(ledNumber, null, null) }
List<String> setLED(ledNumber, String colorName) { setLED(ledNumber, colorName, null) }
List<String> setLED(ledNumber, Integer brightness) { setLED(ledNumber, null, brightness) }
//Main SetLED Function requires all paramaters
List<String> setLED(ledNumber, String colorName, brightness) {