Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with request #740

Closed
rudvfaden opened this issue Jul 22, 2022 · 5 comments
Closed

Error with request #740

rudvfaden opened this issue Jul 22, 2022 · 5 comments

Comments

@rudvfaden
Copy link
Contributor

I am getting an ERROR trying to pass some data to the adapter. I have this function.

  save() {

    let myData = this.dataejers.map((row: dataRows) => {
      return { FREKVENS: row.FREKVENS }
    });
    console.log(myData)
    this.sasService.request('common/updatedata', myData).then(() => {

    })
  }

My data has one col.

image

I am getting this error:

ERROR Error: Uncaught (in promise): r: {"error":{"message":"First letter of table should be alphabet or underscore.","details":""}}
    at resolvePromise (zone.js:1211:31)
    at resolvePromise (zone.js:1165:17)
    at zone.js:1278:17
    at _ZoneDelegate.invokeTask (zone.js:406:31)
    at Object.onInvokeTask (core.mjs:25535:33)
    at _ZoneDelegate.invokeTask (zone.js:405:60)
    at Zone.runTask (zone.js:178:47)
    at drainMicroTaskQueue (zone.js:585:35)
    at ZoneTask.invokeTask [as invoke] (zone.js:491:21)
    at invokeTask (zone.js:1661:18)

Any idea of what is wrong?

@allanbowe
Copy link
Member

allanbowe commented Jul 22, 2022

Hi Rud - your data object should contain a series of table arrays. The name of each array will become the SAS table name.

Each table array contains a series of row objects.

The stringified JSON should look like this (assuming your table is called "sdfvc" and your column is "FREKVENS":

{
	"sdfvc": [{
		"FREKVENS": "PRIMO_BANKDAG_MDR"
	}, {
		"FREKVENS": "PRIMO_BANKDAG_MDR"
	}, {
		"FREKVENS": "PRIMO_BANKDAG_MDR"
	}]
}

More info here: https://sasjs.io/sasjs-adapter/#request-response

@allanbowe
Copy link
Member

Hi @rudvfaden - we've updated the adapter to give a more helpful error message when this issue occurs.

@rudvfaden
Copy link
Contributor Author

rudvfaden commented Oct 11, 2022 via email

@allanbowe
Copy link
Member

Hi @rudvfaden - this is a question best suited for the SASjs Support channel, as it's not specifically adapter related: https://matrix.to/#/#sasjs:4gl.io

Will look to get you an answer there

@rudvfaden
Copy link
Contributor Author

Old issue. You can close it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants