Good day, I am trying to split a return from a query and display the first two items from the array,
Here is the query
a!queryRecordType( recordType: 'recordType!{e408fa22-7df7-4073-ac43-add3091357ab}AIM Asset', fields: { 'recordType!{e408fa22-7df7-4073-ac43-add3091357ab}AIM Asset.fields.{af99cf34-7d26-4a14-b291-4cfff81e3500}name' }, pagingInfo: a!pagingInfo( startIndex: ri!assetID, batchSize: 1 )).data
Which returns: List of AIM Asset - 1 item
I would like to return from the query: ThinkPad P16s
I think I can use the split() function and concat() but I have never done this within a query before.
The other option I have is to take the return and manipulate it in the display field of the summary interface richtext field.
Can someone help me figure out the best way to do this please?
Discussion posts and replies are publicly visible
Hello dan7216
Could you please share the output of your query. A screenshot would help.
I suggest another option too, if your going to reference the field multiple times in your application , why don't you try using "Custom Record Field", This way you only have to use Split() or extract() Only once. It's simpler you can query that field and you can reference it without any worries.
You can either do this.
a!localVariables( local!name: index( a!queryRecordType( recordType: 'recordType!{e408fa22-7df7-4073-ac43-add3091357ab}', fields: { 'recordType!{e408fa22-7df7-4073-ac43-add3091357ab}AIM Asset.fields.{af99cf34-7d26-4a14-b291-4cfff81e3500}name' }, pagingInfo: a!pagingInfo(startIndex: ri!assetID, batchSize: 1) ).data, 'recordType!{e408fa22-7df7-4073-ac43-add3091357ab}AIM Asset.fields.{af99cf34-7d26-4a14-b291-4cfff81e3500}name', {} ), extract(local!name, """", """") )
Or like Venkat said, you can create a "Sync Time" custom record field with the same logic.
Thank you
Why do you want to use "split()"? Are you saying the "name" field will always have some consistent character that you can Split on, for instance split on all spaces or a certain special character, etc?