- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2024 05:08 PM
I have created a custom app. As part of the app, I need to parse an Excel spreadsheet and create records from the data in the spreadsheet. I chose not to use an import for various reasons, although I may be stuck doing that.
I'm using a flow that reads the spreadsheet data and creates rows in a staging table. I'm not having trouble parsing the spreadsheet, but I am having trouble entering it into a staging table because of the headers.
The spreadsheet has column headers like "Asset", "Port", "First Found On", "Name".
I've created an action in Flow - here is the script in the action that is working:
Because logging isn't working with my scoped app (I've opened a Support ticket), I'm unable to determine what the JSON rows and data look like in the action by checking the execution log or script/application logs.
Using a fix script, I was able to determine I can only retrieve the value if I use the exact header - in this case "Asset" must be used and not "asset".
The fix script code
gs.print('### Asset: ' + parsed.Asset + ' / ' + parsed.asset);
returns the output
With a multi-word column header like "First Found On", what is the correct syntax to set the value to the corresponding field in my staging table?
var s = new GlideRecord('my_staging");
s.initialize();
s.setValue('name', parsed.Asset);
s.setValue('first_found_on', parsed.????);
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2024 07:31 PM
@gjz In case of the properties made up of multiple words, you can try the following.
var s = new GlideRecord('my_staging");
s.initialize();
s.setValue('name', parsed.Asset);
s.setValue('first_found_on', parsed["First Found On"]);
Hope this helps.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2024 07:31 PM
@gjz In case of the properties made up of multiple words, you can try the following.
var s = new GlideRecord('my_staging");
s.initialize();
s.setValue('name', parsed.Asset);
s.setValue('first_found_on', parsed["First Found On"]);
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2024 09:32 AM
Thank you Sandeep, it worked.