Hello everyone,
Please Lend me your eyes, I need your help and advice please? I have spent the whole week reviewing threads on this site and You Tube and I'm still nowhere near sorting this problem.
I have two forms (Form A) and (Form B) linked to two SharePoint lists (SP List A & SP List B) because the original list exceeded the columns threshold and now, I’ve split the list in half, hence the reason why I’m using two Edit forms.
In total, there are 6 forms within six screens and the setup is as follows,
SP List A - has the following forms, SharePointForm1 (Screen 1), SharePointForm4 (Screen 4), SharePointForm5 (Screen 5), SharePointForm6 (Screen 6),
SP List B - has the following forms, SharePointForm2 (Screen 2), SharePointForm3 (Screen 3),
The problem I have here is this, the below formula only submits (SP List A) but need both forms submitted to SharePoint lists (SP List A & SP List B) together as this will be classed as one item of information on the data form.
And also, is it possible to edit both forms (Form A) and (Form B) at the same time using the above screens setup?
Because all 6 forms are continuous and will be update through different stages.
Please do let me know if you need any more info.
If(
SharePointForm1.Mode = New,
Patch(
ExcelForm,
Defaults(ExcelForm),
SharePointForm1.Updates,
SharePointForm2.Updates,
SharePointForm3.Updates,
SharePointForm4.Updates,
SharePointForm5.Updates,
SharePointForm6.Updates
),
Patch(
ExcelForm,
{ID: SharePointIntegration.SelectedListItemID},
SharePointForm1.Updates,
SharePointForm2.Updates,
SharePointForm3.Updates,
SharePointForm4.Updates,
SharePointForm5.Updates,
SharePointForm6.Updates
)
);
Notify(
"Submitted Successfully!",
NotificationType.Success
);
Navigate(HomeScreen);
RequestHide();
hi and happy new year!
i have a question you might be able to help me with please?
You helped me with my previous issue with working with 2 x SharePoint Lists (ListA / ListB) and these are working perfectly.
Since then, we have added another new List which we would like to add to the current form.
i have tried the same formula as the previous one but its not working.
LookUp(ListC, ID = SharePointIntegration.Selected.ID)
would you be able to advise if possible please?
Regards,
@v-jefferni Jeffer Ni,
Thank you so much, I have learnt something new this morning thanks to you!
Appreciate you taking the time to help me with this scenario. I’m so happy that it finally is working and also I know understand the logics to how two lists works together.
I cant thank you enough for your time and help. Thank you!
Hi @Moe69 ,
For customize forms, there would be a SharePointIntegration Control, which links to the buttons on SharePoint list page. I assume you have 4 forms that connect to List A, customized form from this list, and you have 4 forms in the App that DataSource bound to List A as well. For the Item properties of the 4 forms, they must be the same, basically are all as follows:
If(IsBlank(SharePointIntegration.Selected) || IsEmpty(SharePointIntegration.Selected),First([@'ListA']),SharePointIntegration.Selected)
This formula is telling you the default item of the forms are SharePointIntegration.Selected, which means the selected item in List A. For the other two forms, they should be bound to List B in DataSource property, get the specific record that "selected" in List B in Item property. Since users actually won't select anything in List B, and the two lists share the same IDs (or any other column value as the key), you will be able to use a LookUp function to get the specific List B item based on the selected List A item.
LookUp(ListB, ID = SharePointIntegration.Selected.ID)
You need to set this LookUp formula in Item of the forms that bound to List B, so that the two forms will be populated a record when in edit or view mode.
Best regards,
Hi,
Good to hear from you again,
I’m having a hard time understanding the logics in creating a lookup, this at the present time is above my head, only been using PowerApps for 1 year but never to this level.
Would be able to suggest an example or share more details about this so that I can work with to understand the logics please?
Any suggestions how I go about or write the formulas in the Item property of all Forms bound to a specific record of respective data source? Doe this formula need to be the same in both List A forms and List B forms?
Sorry the waist your time but your help is very much appreciated. I'm finding this project very difficult
Hi @Moe69 ,
To display the current record in both ListA and ListB, it is need to use the LookUp function.
And ListA and ListB must have a same unique value field for searching. Let's assume that the field's name is NID.
For example, the item of ListA Forms is tt. Then we can set the Item property of ListB Forms to LookUp (ListB, NID=tt. NID) to display the record in ListB.
In short words, you need Item property of all Forms bound to a specific record of respective data source.
Best regards,
Good afternoon,
Thank you for your follow up feedback.
I have updated the formula where you have mentioned to change "SharePointForm1.Mode = FormMode.New". but I’m lost and confused about where you have mentioned the comas and semicolons in the If statement. Is there something wrong with the way the formula written?
Submitting all 6 forms works okay and data is sent to the correct List A and List B correctly, however if I go to Edit or View only List A forms are showing even though 6 screens show up, but no List B forms are showing in either Edit or View mode. Something has gone wrong
Is this possible to get all 6 forms to load up for Editing and Viewing at the same time? If so, any advice where I’m going wrong here, please?
Hi @Moe69 ,
You could change following codes to "SharePointForm1.Mode = FormMode.New". Besides, please be noted that there are comas and semicolons in the If statement:
Best regards,
Hi Jeffer Ni,
Thank you for responding back, your time is very much appreciated.
List A and List B are just one list which I had to break in to 2 parts because the original list was to large, hence why I had to build List A and List B.
List A uses 4 forms so that the forms stay within the column's fields threshold and the same with List B. forms.
The formula you have provided works okay. The forms are submitted to both List A and List B.
The problem is this now, if I go to Edit the request, only List A forms SharePointForm1, SharePointForm4, SharePointForm5, SharePointForm6 are being uploaded for Editing.
List B forms are missing when trying to Edit the request.
Is there a formula to upload both List A and List B forms together for Editing please?
Hi @Moe69 ,
Could you share more details about your scenario? I’m a little confused about your requirement. You say that you have split the list into SP ListA and SP ListB, but actually there are six forms in app.
Do you want to submit the data of six forms to SP ListA and SP ListB? But why patch all data of six forms to the list “ExcelForm”?
Do you want to submit form1, form 4, form 5, form6 to ListA , and submit form2, form3 to ListB?
You could try the following formula:
If(SharePointForm1.Mode = New,
Patch(ListA,
Defaults(ListA),
SharePointForm1.Updates,
SharePointForm4.Updates,
SharePointForm5.Updates,
SharePointForm6.Updates
); Patch(ListB,
Defaults(ListB),
SharePointForm2.Updates,
SharePointForm3.Updates),
Patch(ListA,
{ID: SharePointIntegration.SelectedListItemID},
SharePointForm1.Updates,
SharePointForm4.Updates,
SharePointForm5.Updates,
SharePointForm6.Updates);
Patch(ListB,
{ID: SharePointIntegration.SelectedListItemID},
SharePointForm2.Updates,
SharePointForm3.Updates));
Notify(
"Submitted Successfully!",
NotificationType.Success);
Navigate(HomeScreen);
RequestHide();
Best regards,
WarrenBelz
146,524
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,906
Most Valuable Professional