
I have a power app I have developed that connects to an Azure AI search service. There is a search page for users to search the title, category, and body of a KB article. We use a form to input, edit, and delete the entries in the KB. We decided that we were going to go with a SharePoint list for storing any attachments a user might have such as PDFs, CSVs and image files. The reason why we don't store everything in SharePoint is that the AI search service does not index it properly.
My question is when I store the entry in the database, it creates the Id number as the primary key and I want to tie that to the row in the SharePoint list to pull the attachments from. I will need to save the attachments and the database entry at the same time so that the indexer will retrieve them and display them for users.
I've made the SharePoint list and I can add a small form with only one field, attachments, to show when I have a user fill out the rest of the information, but how do I immediately link them. Is there some sort of Power Automate flow I could use that once the entry is added in the database, pull it and attach the Id to the sharepoint list then when someone wants to view or edit, pull both the entry and the attachments.
As you can see from the form, attachments is a second list added which is linked to a SharePoint list and the rest of the fields are tied to the SQL database.
Updating this to help someone else:
So, I figured it out by creating a column called guid in my SQL database and then having the Title column in my SP list be the guid as well. I have a hidden field underneath the body section of my form that generates a guid and converts it to a text entry (SQL was giving me issues about saving the form using SubmitForm().
Text(GUID())Then, I have the Title field hidden above the attachment control and have it linked to the Text Input for the GUID I just created.
Text: TextInput1.TextWhen it saves, it stores that guid in the database and in SharePoint at the same time. When I go to retrieve the entry, I just have it return the GUID from the SQL database in a gallery view when browsing. I then have a button to View Attachments which takes me to another screen where it fetches the guid from sharepoint based on the
RecordsGallery1.Selected.guid