No errors appear for the following formula, and the SP list updates perfectly EXCEPT for the sections referring to LastSubmit data (in bold). What am i missing?
ForAll(RiskCollection, If(!IsBlank(HazLine),Patch('Change Management Risk Assessessment', Defaults('Change Management Risk Assessessment'),{'Hazard Description':HazLine, Risk:RiskLine, 'Current Controls':CurrentControls, Con1:Consequence, L1:Likelihood, 'Risk Ranking':RR, Planned:Planned, Con2:Con2, Lik2:Like2, FinalRR:FinalRR, CMMasterID: DetailsForm.LastSubmit.ID, 'Change Title':DetailsForm.LastSubmit.'Change Title'})));
Solved! Go to Solution.
Hi @Anonymous :
Could you tell me:
As mentioned by @KrishnaV ,whether DetailsForm.LastSubmit.ID has a value depends on whether the user has submitted DetailsForm in the current user's session.
I assume the DetailsForm's data source is a SharePoint List('Your DataSource').
If you only need to get the ID and ‘Change Title’ of the last modified record.I suggest you can get the last modified record directly through the "modifyed" field.
For example:
Set(Var1,Last(Sort('Your DataSource',Modified,Ascending)).ID);
Set(Var2,Last(Sort('Your DataSource',Modified,Ascending)).'Change Title');
ForAll(RiskCollection, If(!IsBlank(HazLine),Patch('Change Management Risk Assessessment', Defaults('Change Management Risk Assessessment'),{'Hazard Description':HazLine, Risk:RiskLine, 'Current Controls':CurrentControls, Con1:Consequence, L1:Likelihood, 'Risk Ranking':RR, Planned:Planned, Con2:Con2, Lik2:Like2, FinalRR:FinalRR, CMMasterID: Var1, 'Change Title':Var2})));
Best Regards,
Bof
Hi @Anonymous ,
DetailsForm.LastSubmit.ID work with the user's current session, this will always be blank while the user submits for the first time. However, if the user submit 2 time it will get the DetailsForm.LastSubmit.ID values.
I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.
Regards,
Krishna
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.
Hi @Anonymous :
Could you tell me:
As mentioned by @KrishnaV ,whether DetailsForm.LastSubmit.ID has a value depends on whether the user has submitted DetailsForm in the current user's session.
I assume the DetailsForm's data source is a SharePoint List('Your DataSource').
If you only need to get the ID and ‘Change Title’ of the last modified record.I suggest you can get the last modified record directly through the "modifyed" field.
For example:
Set(Var1,Last(Sort('Your DataSource',Modified,Ascending)).ID);
Set(Var2,Last(Sort('Your DataSource',Modified,Ascending)).'Change Title');
ForAll(RiskCollection, If(!IsBlank(HazLine),Patch('Change Management Risk Assessessment', Defaults('Change Management Risk Assessessment'),{'Hazard Description':HazLine, Risk:RiskLine, 'Current Controls':CurrentControls, Con1:Consequence, L1:Likelihood, 'Risk Ranking':RR, Planned:Planned, Con2:Con2, Lik2:Like2, FinalRR:FinalRR, CMMasterID: Var1, 'Change Title':Var2})));
Best Regards,
Bof
OMG Bof! you are a LEGEND!! Thanks so much!! 😍