Hi
Not sure if this is possible...
I have a collection which collects results from previous screens and results in multiple rows being inserted in to the collection. Due to the media attachment file sizes, I'd like to iterate through each row in the collection one by one and submit it to the 'submitResults' flow. I tried adding a rowCount to count the rows in the collection but seem to have got lost somewhere. Can anyone advise if what I'm trying to do is possible and how I could amend my code to do it?
Set(rowCount,1);
ForAll(
Gallery4.AllItems,
Collect(
SubmitAuditRequest,
{ ID:rowCount,
results: [
{
questionKey: Value(lblQKey.Text),
successCriteriaMet: txtQSCM.Text,
addToActionPlan: false,
additionalComments: txtQComments.Text,
typeCode: lblQTypeCode.Text,
additionalQuestionText: lblQAdditionalQuestionText.Text,
score: txtQGrade.Text,
actions: [
{
parentKey: Value(lblQKey.Text),
parentTypeCode: "RECORD_PARENT_TYPE_##3",
action: txtQActions.Text,
dateRequired: txtQActionDue.Text,
assignedToKey: LblQUserKey.Text,
statusCode: "ACTION_STATUS_TYPE_##1",
priorityCode: "PRIORITY_TYPE_##3"
}
],
attachments: If(
Value(lblQKey.Text) in AudioClips.questionKey Or Value(lblQKey.Text) in CameraPhotos.questionKey,
[
{
parentKey: Value(lblQKey.Text),
parentTypeCode: "RECORD_PARENT_TYPE_##3",
documentBase64: LookUp(
CameraPhotos,
questionKey = lblQKey.Text
).Base64String,
name: LookUp(
CameraPhotos,
questionKey = lblQKey.Text
).Note,
extension: "img",
attachmentTypeCode: "RECORD_DOCUMENT_TYPE_##1"
},
{
parentKey: Value(lblQKey.Text),
parentTypeCode: "RECORD_PARENT_TYPE_##3",
documentBase64: LookUp(
AudioClips,
questionKey = lblQKey.Text
).base64Audio,
name: LookUp(
AudioClips,
questionKey = lblQKey.Text
).audioDescription,
extension: ".3gp",
attachmentTypeCode: "RECORD_DOCUMENT_TYPE_##2"
}
]
)
}
]
}
);
);
If(
Connection.Connected,
Set(
SubmitAuditRows,
CountRows(SubmitAuditRequest)
);
If(
SubmitAuditRows > 0,
SubmitAuditRequest,
LookUp(SubmitAuditRequest,ID=rowCount,
SubmitResults.Run(
JSON(SubmitAuditRequest),
userSettings.token,
userSettings.Key,
auditKey.auditKey
);
);
);
);

Report
All responses (
Answers (