I have this code below that I've been working on that is copying some records from one place to another. The collection the data is coming from does not have a unique identifier, yet the table I'm patching needs a unique ID.
My current code for QID below only results in a value of 1 for all patched records. What I'd like to happen is if I patched 6 records I want the QID to be 1,2,3,4,5,6 respectively.
How do I get each loop of the ForAll to write a +1 QID?
ForAll(colAssessments, Patch(TempQuestions,Defaults(TempQuestions),{AssessType: colAssessments[@AssessType],Category: colAssessments[@Category],QuestionText: colAssessments[@Question],QID: Max(QID) + 1, A1Text: colAssessments[@A1],A2Text: colAssessments[@A2],A3Text: colAssessments[@A3],Timestamp: Text(Now()),User: User().FullName} ))
Btw... I've seen this video linked in another post, it didn't work for what I'm trying to do. https://www.youtube.com/watch?v=plKw_xfVfwY&feature=youtu.be