Hi all,
My code below is to patch to my SharePoint List from a collection, colSubmittedQuestion which being populated by a gallery.allitems, and it is working perfectly if I don't have the RemoveIf statement in it.
Without removing the blank or empty records, the patch function patches ALL items.
My TriagedScore column is a type choice and it has 1,2,3 as choices inside a gallery and all items are being collected into a collection called colSubmittedQuestion. Please see the image below.
My code:
ForAll(
RemoveIf(colSubmittedQuestion, IsBlank(TriagedScore) || IsEmpty(TriagedScore)), // this is the statement I need help with
RenameColumns(colSubmittedQuestion,"ID", "SID"),
Patch('Fenced Triaged Review Checklist',
LookUp('Fenced Triaged Review Checklist',ID = SID),
{ProgramName:ProgramName, ProgramID:Value(ProgramID),
ARIWGInitialDate:ARIWGInitialDate, ARIWGCompletionDate:ARIWGCompletionDate,
PriARIWGPOC:PriARIWGPOC, AltARIWGPOC:AltARIWGPOC, Member:Member,
SIMAlignment:LookUp(Choices('Fenced Triaged Review Checklist'.SIMAlignment),Value=SIMAlignment.Text), SectionNumber:Value(SectionNumber.Text),
TriagedScore:LookUp(Choices('Fenced Triaged Review Checklist'.TriagedScore),Value=TriagedScore),
QuestionNumber:Value(QuestionNumber), Question:Quesion, ARIWGComment:ARIWGComment, BusinessOwnerComment: BusinessOwnerComment,
ResultCommunicate2POC:ResultCommunicate2POC, Resultof2Submission:Resultof2Submission,
SecondSubmissionDate:SecondSubmissionDate, OverallAssessComment:OverallAssessComment,CMB:CMB
}
));
Thank you in advance.
Solved! Go to Solution.
you can try this
ForAll( RemoveIf(RenameColumns(colSubmittedQuestion,"ID", "SID"), IsBlank(TriagedScore) || IsEmpty(TriagedScore)),
Patch('Fenced Triaged Review Checklist', LookUp('Fenced Triaged Review Checklist', ID = SID),
{
ProgramName: ProgramName,
ProgramID: Value(ProgramID),
ARIWGInitialDate: ARIWGInitialDate,
ARIWGCompletionDate: ARIWGCompletionDate,
PriARIWGPOC: PriARIWGPOC,
AltARIWGPOC: AltARIWGPOC,
Member: Member,
SIMAlignment: LookUp(Choices('Fenced Triaged Review Checklist'.SIMAlignment),Value=SIMAlignment.Text),
SectionNumber: Value(SectionNumber.Text),
TriagedScore: LookUp(Choices('Fenced Triaged Review Checklist'.TriagedScore),Value=TriagedScore),
QuestionNumber: Value(QuestionNumber),
Question: Quesion,
ARIWGComment: ARIWGComment,
BusinessOwnerComment: BusinessOwnerComment,
ResultCommunicate2POC: ResultCommunicate2POC,
Resultof2Submission: Resultof2Submission,
SecondSubmissionDate: SecondSubmissionDate,
OverallAssessComment: OverallAssessComment,
CMB: CMB
}
)
);
you can try this
ForAll( RemoveIf(RenameColumns(colSubmittedQuestion,"ID", "SID"), IsBlank(TriagedScore) || IsEmpty(TriagedScore)),
Patch('Fenced Triaged Review Checklist', LookUp('Fenced Triaged Review Checklist', ID = SID),
{
ProgramName: ProgramName,
ProgramID: Value(ProgramID),
ARIWGInitialDate: ARIWGInitialDate,
ARIWGCompletionDate: ARIWGCompletionDate,
PriARIWGPOC: PriARIWGPOC,
AltARIWGPOC: AltARIWGPOC,
Member: Member,
SIMAlignment: LookUp(Choices('Fenced Triaged Review Checklist'.SIMAlignment),Value=SIMAlignment.Text),
SectionNumber: Value(SectionNumber.Text),
TriagedScore: LookUp(Choices('Fenced Triaged Review Checklist'.TriagedScore),Value=TriagedScore),
QuestionNumber: Value(QuestionNumber),
Question: Quesion,
ARIWGComment: ARIWGComment,
BusinessOwnerComment: BusinessOwnerComment,
ResultCommunicate2POC: ResultCommunicate2POC,
Resultof2Submission: Resultof2Submission,
SecondSubmissionDate: SecondSubmissionDate,
OverallAssessComment: OverallAssessComment,
CMB: CMB
}
)
);
Thank you Alex. I tried your modified code and it did take care of the error. However, it still went thru and updated all of the gallery items including the blank/empty ones.
Any other suggestion? I was thinking of instead doing the remove blank/empty items, just update the ones which has value of 1,2,3 in the column but not sure how to modify the code.
Hi Alex, sorry that I spoke too soon. It did work with your modified code. Thank you so much.
Another question though related to this code. How would I modify this code just to update the items which being changed or modified?
User | Count |
---|---|
122 | |
87 | |
86 | |
75 | |
67 |
User | Count |
---|---|
214 | |
181 | |
137 | |
96 | |
83 |