UI Builder Create Record

Tadz
Tera Guru
Tera Guru

Hi Everyone,

I'm using ui builder create record operation.

In my client script i have these:

api.data.create_record_1.execute({
		'table': 'kb_social_qa_question',
		'templateFields': templateFields,
		'useSetDisplayValue' : false
	});

Somehow if i have text inside a quotation it will not properly read the templatefields.

can we specify in the parameters the field name directly instead?

Thanks,

Tads

8 REPLIES 8

Velma
Tera Guru

There were field types I never figured out in the encoded query. It is not an elegant way to try to create or update data, to say the least. But I did document what I learned about escaping and what needed to be escaped. Perhaps it may be helpful to you. UI Builder Encoded Query for Update Record - Developer Community - Question - ServiceNow Community

Hi Velma, I will check this out! 🙂 

Brad Tilton
ServiceNow Employee
ServiceNow Employee

I would add to this that while that Create Record data resource is available to use, it may not work for all use cases and the encoded query parameter can be limiting. You could create your own GraphQL, REST, or Transform data resources that mutate data as well.

I've got an article showing how to create a data resource and we're working on additional content around data resources at the moment.

JagjeetSingh
Kilo Sage
Kilo Sage

Hi,

You can check out if there was any error while executing your data source. You can use below code in your script to check the output of our data source. Call this script from all three events of your data source to see the output.

console.log("OUTPUT" + JSON.stringify(event.payload));

Alternatively, you can create your own data source. Check out my article here how you can create it.

 

Jagjeet Singh
ServiceNow Community Rising Star 2022/2023