Hi guys, I'm hoping someone can help me out with the most efficient way of doing this.
I am trying to create a mechanism where records are linked to a previous record using another column that references the ID of the row it is linked to in a SharePoint List.
I currently have a gallery with combo boxes and text inputs that are patched to the SharePoint list using a ForAll and Patch as below. The ID's in the gallery are purely for the user to be able to link them using the "Follow From" column. When patched, the IDs will be the automatically created IDs in SharePoint.
When the records are patched to SharePoint, I there need to get the ID that are created and use them in place of the Follow From options, something like this:
Gallery that users populate:
SharePoint List:
ID |
Previous ID |
14 |
|
15 |
14 |
16 |
14 |
I'm guessing this will need to be 2 patches with a return of the IDs in between, but I'm hoping someone can help me out with the best way of doing it.
1. Patch records to SharePoint whilst returning IDs
2. Translate Follow From IDs to actual SharePoint IDs
3. Patch Previous ID to SharePoint list
Here how far I've got:
Input Gallery:
Initial Patch Command:
Set(LastPatch,
ForAll(Gallery1.AllItems,
Patch('Design Activities',Defaults('Design Activities'),
{
Title: TextInputCanvas3_2.Value,
Category: ComboboxCanvas6.Selected,
Status: ComboboxCanvas6_3.Selected,
Designer: ComboboxCanvas6_1.Selected,
link_op: globalCurrentOP.ID
}
)
).ID
);
I've managed to get the newly created ID's by surrounding the ForAll with a Set command as above, but I'm struggling with where to get go next.