Loop Automation Command Action

Maybe I missing something, Can JS call automation command or action now? Never explore JS side quite a while.

It would be better for sure if we can call Action / Automation via script.

Yes cmd.Execute('name:value'); should trigger automation command called name with value command parameter.

I’m not sure if I’ve mentioned it before or not… Sorry :wink:

3 Likes

Ah, that is better then. I obviously missing something.

1 Like

We can also call GQL API queries via embedded JS so we’ll have more options by .61 release.

So we can only pass 1 value which equates [:CommandValue] ? Ok so I would still use Data.Set/Get for multiple values correct?

PS: @emre I truly love the ability to create parameters such as the “Deliverer Tutorial” i.e. AccountDocumentToUse="Some Name" and then reference it in ACM as [:AccountDocumentToUse] - that is fantastic (more please when creating new stuff…).

Wouldn’t it be better to try it first and request a feature if it does not exists?

Well it is 5:40 AM here. Maybe you didn’t requested something lol… I’m going to sleep but I have this in my copy paste cache so I’m posting it here not to loose it. I hope I’ll remember what to do with that.

https://www.git-tower.com/blog/content/posts/54-git-cheat-sheet/git-cheat-sheet-large01.png

1 Like

Was that directed at me? Sorry I do not know what you are referring to as “it” - If it was multiple parameters such in Search Entity Screen I am doing that?

Ah “sleep” it is overrated! (That’s what I tell my wife…)

Hmm… a lot of things still need to execute via Automation Command Rule. I was hoping we just have one Execute script command in the rule and run everything in script, I guess not. Have to think about it more.

Wouldn’t it be cleaner if we have this Loop Automation then? Using dynamic ACM name, it is not problem for veteran here. I thought it would be easier average users to accomplish the task easier with this action. I think using script still need more expertise especially, passing data between automation and script.

I am thinking like average users point of view when they want to execute something they create rule and then add actions step by step then wait how can I loop this/how can I stop this. If there is this Loop action they don’t even have to touch script.

Well I was trying so hard to stay at this level but was drawn into the “Dark Side” by the force (picture @Jesse as Darth Vader…)

I just had another look at my Script and creating Multiple parameters using Data.Set() will do the trick so I could bypass your loop :cry: and stay in the script calling the ACM. For now no need to change a pretty good thing as it works.

1 Like

Still a lot of secret in the Dark side and now we gonna have black hole (GraphQL) for endless hidden secret lol

That’s why I mentioned it here. Having more GraphQL functions will improve possibilities.

I have not seen this before. Added to the Helper doc. Are there more?

2 Likes

I can see this being very useful :slight_smile:

How to use it? I got

I create Rule for Automation Command

And run this script

function test() {
cmd.Execute(‘Automation Show Message:Test’);
}

2 Likes

Any suggestion on this cmd.Execute('name:value'); @emre

Hey @sukasem

Lodge an issue, I think you can split your post off from the error message. I am very keen to see the answer as well.
I would maybe change your Rule Name first just in case it is a reserved word…

Don’t know how to split the topic :blush:
Have you tried it? Rule name is not issue I changed it still get error.

For some reason, at first I could not get this to work from the Test button at the bottom-right of the Script Editor.

function execAMC() {
  cmd.Execute('TestCommand:TestValue');
}

MessageToDisplay:

CN: [:AutomationCommandName]\rCV: [:CommandValue]

So I thought I would get funky and add it to the Close button …

Now when I click close button, I see this:


And the Test button also now works …

Hmm…So, if the Automation has been executed by ordinary way once before then it work?

Not sure. But I will say this: I have had issues with the Test facility before, many times, and has almost driven me over the edge when I know my script is good and it keeps throwing the same error over and over again.

It seems that it may not work until you save the script, close the Script screen, navigate somewhere else (or logout), then go back in to test it.

I have had this type of trouble when creating new scripts, or when I script has an error in it. It is like it gets “stuck in memory” and ignores changes, and I need to “reset cache” to get it to behave again. Maybe it is only committed to the DB after saving, then closing the script screen, and navigating away and back in.

1 Like