I have built a no-form control form and so far have been able to get it working perfectly for entering data. I am now trying to get the form to work for editing. RiskID is passed as a parameter through the URL (sample: AP000368). The RiskID received tells me which list and which item the user wishes to preload into the form in order to view or edit. Typically, the following format in the APP section does the trick:
Set(VarParamTitle,LookUp('Asia Pacific', RiskID = myparamRiskID, Title));
Then I place the variable in the "Default" section for the field and it then loads the appropriate data. I have many lines like this as it is a big form and there are 11 potential data sources that it could be from. Here are my issues:
- When trying to populate a combo box field converted into a multi-people picker field it doesn't populate. I realize that it is expecting an input similar to this:
{
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Claims: "i:0#.f|membership|" & ThisRecord.Mail,
Department: "",
DisplayName: ThisRecord.DisplayName,
Email: ThisRecord.Mail,
JobTitle: "",
Picture: ""
}
But likely several of these if it has more than one person entered. How do I lookup this info from a sharepoint list and then craft it into this format so that i can pre-populate a field? Maybe a collection? I have four of these fields to do. Names are "Risk Owner(s)", "Treatment Owner(s) 1", "Treatment Owner(s) 2", and "Treatment Owner(s) 3". Here's my try that doesn't work (maybe someone can fix it):
ForAll(
LookUp('Asia Pacific', RiskID = myparamRiskID, 'Risk Owner(s)'),
Collect(
colRiskOwnersToPopulate,
{
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Claims: "i:0#.f|membership|" & LookUp('Asia Pacific', RiskID = myparamRiskID, 'Risk Owner(s)'.Mail),
Department: "",
DisplayName: LookUp('Asia Pacific', RiskID = myparamRiskID, 'Risk Owner(s)'.DisplayName),
Email: LookUp('Asia Pacific', RiskID = myparamRiskID, 'Risk Owner(s)'.Mail),
JobTitle: "",
Picture: ""
}
)
);
Thoughts?
- The other issue i'm having is with Attachments of course. I'm using an Attachments field that was copied out of a form control. To use it in my intake form i had to use Flow and/or a Patch but Flow proved easier. Now i'm trying to read sharepoint to see if the item has any attachments and then populate them as saved items in the field.
- i realize that this may need to be done differently and that i might need to filter a gallery to display the attachments or
- potentially i remove the attachments component i added and add a form control with just the attachments, filter it and give it its own save button.
Which method works, so far i can't get it to work. - Why did i build this form with no form control? The form needed to be responsive and fill the screen. I found the form control and data card method very clunky and hard to configure for layout. Previous developer failed to please the client layout-wise and so this is the second attempt with no form control and so far layout is perfect (except for the two points above)