Create request through import set
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-01-2022 09:48 AM
Whenever a new user is added to 'User' table, raise a request to deliver laptop for the new user through import set.
I tried this OnBefore Transform Script -
var cart = new Cart();
var item = cart.addItem('04b7e94b4f7b4200086eeed18110c7fd');
var rc = cart.placeOrder();
the issue is - it is creating request for all users, it should create request for new users only and in requested by field, the name of that new user should be populated.
Note - I am using Load Data(excel file) and an existing import set table and transform map.
Please help me with this.
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-01-2022 09:57 AM
Save yourself a lot of trouble and just use flow designer instead. This can be accomplished very easily, see below as an example
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-01-2022 10:14 AM
hello,
Please use on after transform script with below code:-
if(action=='insert')
{
var cart = new Cart();
var item = cart.addItem('04b7e94b4f7b4200086eeed18110c7fd');
var rc = cart.placeOrder();
cart.requested_by = target.sys_id;
}
Please mark my answer as correct based on Impact
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2022 11:03 AM
Requested for is not getting populated with that particular user name.
I used -
cart.requested_for = target.sys_id;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2022 11:04 AM
It is getting populated as System Administrator.