- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2022 01:41 AM
Hello,
So I have a DataSet that looks like this:
{ Name : testvalue1,
Name : testvalue2
}
But I want to change the key ‘Name’ into the value it contains: output
{ testvalue1 : testvalue1,
testvalue2 : testvalue2
}
It’s needed because after that I want to fil all the keys with the right data and do an SQL insert with the Keys as the column names.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2022 01:49 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2022 01:49 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2022 02:05 AM
Thank you for your answer.
I See it now. It Works
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2022 03:26 AM
Hi @bojanvelevski ,
I Have another question about the same scenario but little more difficult.
So the output is this.
AllData{
Dataset1
[{Fieldname:Fieldname1
Value: Value1},
{Fieldname:Fieldname2
Value: Value2}],
Dataset2[]
}
The goal is to change every fieldname to the value of the fieldname like you showed. But this needs to be done for every Dataset. This is to get all the columnames from an SQL Server.
Thank you in advance

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2022 03:33 AM
$AllData.mapValues((v,k)=>v.map(x=>x.mapKeys((v1,k1)=v1)))
I belive something like this should work
