AutomaApp / automa

A browser extension for automating your browser by connecting blocks
https://www.automa.site
Other
10.78k stars 1.1k forks source link

Condition builder: Handle full Expression for "data" condition type #1596

Closed slavi010 closed 6 months ago

slavi010 commented 6 months ago

Hello!

For the Condition builder, its not possible to do this: image

The issue is in the file testConditions.js Where:

if (type.startsWith('data')) {
  let dataPath = data.dataPath.trim().replace('@', '.');
  const isInsideBrackets =
    dataPath.startsWith('{{') && dataPath.endsWith('}}');

  if (isInsideBrackets) {
    dataPath = dataPath.slice(2, -2).trim();
  }

  const parsedPath = keyParser(dataPath, workflowData.refData);
  dataPath = `${parsedPath.dataKey}.${parsedPath.path}`;

  return objectPath.has(workflowData.refData, dataPath); // here
}

Where it should, like for the other, parse it with

await renderString(...);

I doesn't have the time to do a pull request/test it, soo if someone can do it for me, thx ! :)

Have a nice day ❤️