AutomaApp / automa

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

Insert data : Handle Expressions in Variable Name. #1598

Closed slavi010 closed 9 months ago

slavi010 commented 9 months ago

Hey (again) !!

Same happen here than the issue #1596 (btw, thx you for the fix, it work super well <3)!

But in this situation image

It would do something like this: image

(and before mentioning it, the automa table doesn't really meet my needs :'))

Sooooooo in handlerInsertData.js:

if (item.type === 'table') {
  const values = typeof value === 'string' ? value.split('||') : [value];
  values.forEach((tableValue) => {
    this.addDataToColumn(item.name, tableValue);
  });
} else {
  await this.setVariable(item.name, value);
}

To something like this:

const varName = await renderString(
  item.name,
  refData,
  this.engine.isPopup
);
if (item.type === 'table') {
  const values = typeof value === 'string' ? value.split('||') : [value];
  values.forEach((tableValue) => {
    this.addDataToColumn(varName , tableValue);
  });
} else {
  await this.setVariable(varName , value);
}

Regards, Slavi