Dear all,
I need to turn the results of the below query into an array including all "submissionunit"s to further use the wherecontains() formula on that.
Could anybody tell me which function to use to create an array in that case?
local!datasubset2: a!queryEntity( entity: cons!MR_ABGABE_DSE, query: a!query( selection: "submissionunit", filter: a!queryFilter( field: "submissionperiod", operator: "=", value: local!period ), pagingInfo: local!pagingInfo2 ), fetchTotalCount: false )
Thank you very much in advance!
Chris
Discussion posts and replies are publicly visible
a!queryEntity will return a datasubset. You can index into datasubset using the field 'data', for example 'local!datasubset2.data' and this will return a list of dictionary. Appian dictionaries can be sliced, this means you can also index into a specific field to get a list of data for that field. For example, 'local!datasubset2.data.submissionunit'. However, since indexing with dot notation might break if the field does not exist, I recommend using the index function. 'index(local!datasubset2.data, "submissionunit", {})'
Hi ,I actually wanted to convert the record query output in map format like (Key,value)
I am learning Appian and cannot find any forums that helps.Can anybody help in this case?Thanks in advance,Tanuj
As Denny said get your data in to dictinonary and then cast it to map more details at- docs.appian.com/.../fnc_system_map.html
Not really sure what you hoping your output will look like but this will convert your record into a map.
a!localVariables( local!data: a!queryRecordType( recordType: /*Record Type*/ , filters: {} pagingInfo: a!pagingInfo( startIndex: 1, batchSize: 10 ) ).data, a!forEach( items: local!data, expression: a!map( value: /* fv!item[recordType.field] */ ) ))